Htaccess Forwarding

I am trying to install a symfony based website on a shared hosting server. I can only write in / www /.

The problem is that symfony will be in / www / web /; Is there any way to serve

www.example.com/web/index.php/something 

when users request:

 www.example.com/index.php/something 
+3
source share
2 answers

Try this rule in the .htaccess file in the document root:

 RewriteEngine on RewriteRule !^web/ web%{REQUEST_URI} 

This will add /web to every request whose path does not start with /web/ yet.

+3
source
 RewriteCond %{REQUEST_URI} !/web/ RewriteRule ^(.*)$ /web/$1 [L] 
0
source

Source: https://habr.com/ru/post/1205206/


All Articles