HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How can we add a prefix in URL for vanilla routes?

We have a requirement where we want to have a prefix before vanilla urls.

For example -

Current URL for application: dev.vaniila.com (working fine)

Need to do: dev.vanilla.com/community/

Kindly suggest.

Comments

  • don't use the framework to do the server rules and file management. that is the tail wagging the dog.

    grep is your friend.

  • R_JR_J Ex-Fanboy Munich Admin

    If you put it in a sub folder, you need to change the #RewriteBase line in yor htaccess file


  • We are not putting it inside the subfolder instead trying to create a reverse proxied link.

    For example:

    Our main website is www.abc.com and want to point (reverse proxied) www.abc.com/community to xyz.com (vanilla application)

    Any help will be appreciated.

  • R_JR_J Ex-Fanboy Munich Admin

    I would do this

    But if you want to implement this on a PHP level (for whatever reason), search for something like that

    But if it is your server, don't go with the PHP workaround and use the web server solution.


  • the framework isn't a server you can create reverse proxy though server rules. Server are designed handle http request rooting efficiently php isn't, pre/post processing aside.

    grep is your friend.

  • Okay thanks for your inputs.

    Actually, we have got it setup on server using Nginx. But now the problem is when the application running on ``www.abc.com/community (reverse proxied link) then it is loading vanilla framework assets i.e JS CSS etc from root like www.abc.com/applications/xyz/designs/style.css instead of www.abc.com/community/applications/xyz/designs/style.css

    so do we need to add "community" prefix hardcoded in vanilla routes or need to write an nginx rule for it too?

    Kindly suggest.

  • post your server rules.

    grep is your friend.

  • x00x00 MVP
    edited August 2018

    Btw reverse proxies do various things. A full reverse proxy is essentially a mirror so will rewrite the urls. However that is not usually what people want.

    often you don't actually want to serve asset through proxy pass if you can avoid it, for one nginx is better as serving the static content. However when you do use the proxy pass for dynamic content you can set server vales so the framework behave If the reason you are using a reverse proxy is to support Apache then don't, you're better off just sticking to nginx.

    There are also other reason why you would use a reverse proxy, especially with a multi server net.

    I would need to see your server rules to see what your use case is, and if you need a revere proxy at all.

    grep is your friend.

Sign In or Register to comment.