apache - Redirecting a domain with htaccess with a few specific 301s -


is possible redirect old traffic new site 301.

rewriteengine on rewritebase / rewritecond %{http_host} !new-example.com$ [nc] rewriterule ^(.*)$ http://new-example.com/$1 [l,r=301] 

however, need manually map pages new equivalent pages

redirect 301 /about http://new-example.com/about-us 

is possible both?

if going use rewrite, use only. don't recommend use both mod-alias , mod-rewrite. can use rewrite map individual pages too. order matters. catchall rule should last one. provide cleaner code imo.

rewriteengine on rewritebase /  rewritecond %{http_host} !^new-example.com$ [nc] rewriterule ^about/?$ http://new-example.com/about-us [r=301,l]  rewritecond %{http_host} !new-example.com$ [nc] rewriterule ^(.*)$ http://new-example.com/$1 [l,r=301] 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -