Friday, 15 March 2013

.htaccess - 301 correct way to redirect a directory -



.htaccess - 301 correct way to redirect a directory -

i wondering right way redirect this:

redirect 301 /about/$ http://domain.com/new-about/ redirect 301 /about$ http://domain.com/new-about/ redirect 301 /about/me http://domain.com/new-about/

that's how , works believe there should improve way?

i have 2 pages rewrited, 1 page subpage of other page /about/me/, both pages should redirect new page new-about

you should either utilize redirectmatch or utilize mod_rewrite perform regular look matching. should work , shortest , best performing solution:

redirectmatch 301 ^/about /new-about/

domain , protocol optional - leaving them out maintain them were, future proof.

.htaccess redirect

No comments:

Post a Comment