On my website, www.example.com/
shows files which are in /
, the root folder. But what I want is that example.com/
shows files which are in /www/
. So I add the following code in my .htaccess
file :
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ /www/$1 [L]
But it displays a 500 error. Somebody could say to me what is wrong ?
Try this code :
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule ^(.*)$ /www/$1 [L]
It will rewrite the url once and stop the redirection loop.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments