.htaccess - 301 Redirect a folder to a single page -


i have folder on website has been superceded , want redirect attempt access file in folder current home page.

i have read many questions here none seem this.

i have tried various things in .htaccess seems append filename redirect address.

redirect 301 old/$ www.example.com/index.html redirect 301 old/ www.example.com/index.html redirect 301 ^old/ www.example.com/index.html 

i have seen various mentions of rewriterule. need use that?

you can use code in /old/.htaccess file:

rewriteengine on  rewriterule ^ http://www.example.com/index.html [l] 

or root .htaccess use:

rewriteengine on  rewriterule ^old(/.*)?$ http://www.example.com/index.html [l,nc] 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -