themrrobert
asked on
Apache Rewrite: How to redirect without infinite loop.
I'm using this code and trying to make / route to /site/
/index.phtml -> /site/index.phtml
This code makes an infinite loop of site/site/site/site/site/s ite/...
/index.phtml -> /site/index.phtml
This code makes an infinite loop of site/site/site/site/site/s
RewriteEngine On
RewriteRule ^(.*)$ /site/$ [R,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nice trick
Note that for some servers you might need the rewrite rule to rewrite to a full http address
RewriteRule ^(.*)$ http://mydomain.com/site/$1 [L]
...
RewriteRule ^.*$ http://mydomain.com/site/index.phtml [L]
Note that for some servers you might need the rewrite rule to rewrite to a full http address
RewriteRule ^(.*)$ http://mydomain.com/site/$1 [L]
...
RewriteRule ^.*$ http://mydomain.com/site/index.phtml [L]
ASKER
Here is my .htaccess:
If anyone can also make it route / to /site/ that would get the points now.
Open in new window