.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?

  1. your rule incorrect since %{request_uri} variable has starting /
  2. you need place in document root

use code in document root .htaccess:

rewriteengine on rewritecondition %{request_uri} !^/directory/ rewriterule ^(.*)$ /directory/$1 [l] 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -