.htaccess - Hiding Directory in URL with htaccess is not working -
i have website1.com setup when users visit website1.com redirected via meta tag in index.html website1.com/directory
then use website , go links such website1.com/directory/index.html or ever. trying hide "directory" in link users see website1.com/index.html
i have place htaccess rewrite url website1.com/index.html @ website1.com/directory/.htaccess
i not doing else special , should easy task. current exact htaccess follows:
rewriteengine on rewritecondition %{request_uri} !^directory/ rewriterule ^(.*)$ directory/$1 [l]
should easy right..... 404
in server have mod_rewrite & mod security , suspect 1 of them causing not work can't imagine why. missing here?
- your rule incorrect since
%{request_uri}
variable has starting/
- you need place in document root
use code in document root .htaccess:
rewriteengine on rewritecondition %{request_uri} !^/directory/ rewriterule ^(.*)$ /directory/$1 [l]
Comments
Post a Comment