Let's say I have thiswww.example.com
site structure:
/srv/http/
/srv/http/site/index.php
/srv/http/site/stuff.php
I want the following rewrites/redirects to happen:
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 www.example.com/
redirects to www.example.com/site/
. But the user sees the original URL in the browser.
I've looked around on the internet but haven't managed to figure out what to use in this particular situation.
I tried rewriting everything:
RewriteEngine On
RewriteRule ^$ /site [L]
but index.php
disappears and www.example.com/site/
is shown to the user.
How can I use .htaccess
to solve this problem?