Let's say I have a site structure www.example.com:
/srv/http/
/srv/http/site/index.php
/srv/http/site/stuff.php
I want the following rewrites / redirects to occur:
www.example.com/index.php→ redirects to → www.example.com/site/index.php→, but the user sees →www.example.com/index.php
www.example.com/stuff.php→ redirects to → www.example.com/site/stuff.php→, but the user sees →www.example.com/stuff.php
In general, everything after is www.example.com/redirected to www.example.com/site/. But the user sees the source URL in the browser.
I looked on the Internet, but could not figure out what to use in this particular situation.
I tried to rewrite everything:
RewriteEngine On
RewriteRule ^$ /site [L]
but index.phpdisappears, and the user is displayed www.example.com/site/.
How can I use .htaccessto solve this problem?
source
share