this is my file structure at the web server:
DOCUMENT_ROOT/
foo/
www/
.htaccess
bar/
index.php
What i should write to foo/.htaccess, if I want to redirect everything from www.myserver.com/foo/www/ to www.myserver.com/foo/?
I tried this:
RewriteEngine On
RewriteRule ^(.*)$ /www/$1 [L,NE]
But error 404 is always shown. I tried elaborate with RewriteBase also with no success.
Thanks a lot
P.S. When www/ and .htaccess is in DOCUMENT_ROOT, it works OK. But when I put them to subfolder, always getting error 404 🙁
This will never work if your htaccess file is in
/foo/wwwbecause it won’t take effect unless the request is for something inside/foo/www. The request is only/fooso the.htaccessfile is ignored. You’ll need to either move the.htaccessfile to the document root, changing it to:or move it to the
/foodirectory, changing it to: