xml - redirect 301 - page for page (apache) html to htm and non www -
xml - redirect 301 - page for page (apache) html to htm and non www -
the server apache, not know means.
needs/notes:
redirect visits www.oldsite.com , oldsite.com www.newsite.com old site uses .html extension , new site uses .htm about half file names in new site match of old site need specify redirect each page.here sample code:
options +followsymlinks rewriteengine on rewriterule (.*) http://www.newsite.com/$1 [r=301,l] redirect 301 /index.html http://www.newsite.com/index.htm redirect 301 /pagetwo.html http://www.newsite.com/pagetwo.htm redirect 301 /pagethree.html http://www.newsite.com/thishasanewname.htm currently work home page when types www thats it. can help telling me how accomplish goals in one:
to summarize need redirect traffic old site new site html file names not match, have started using .htm extension old site uses .html , need visits both www. , non www version of old site redirect www version of new site.
please help me out - i'm not coder , stuff hard me
doug
replace rules in .htaccess above ones below.
options +followsymlinks rewriteengine on rewritebase / #1 redirect home page old->new rewritecond %{http_host} oldsite\.com$ [nc] #send home page old new rewriterule ^$ http://www.newsite.com [l,r=301] #2 place redirects here not have exact equivalents on newsite #3 section rewritecond %{http_host} oldsite\.com$ [nc] #send requests html htm (assuming else same) rewritecond %{request_uri} ^(.+\.htm)l[nc] rewriterule ^ http://www.newsite.com%1 [l,r=301] section #1 redirect home page of old site home page of new.
section #3 redirect http://oldsite.com/anypage.html http://newsite.com/anypage.htm
section #2 if there files not have exact equivalents on new site (minus .html -> .htm) in #3, place here before #2 e.g.
redirect 301 /pagethree.html http://www.newsite.com/thishasanewname.htm xml .htaccess http-status-code-301
Comments
Post a Comment