regex - Redirecting folder from one domain to another using .htaccess 301 redirect -
i'm trying figure out rewrite redirect directory , of it's files & subdirectories 1 domain another.
here achieve:
olddomain.com/oldfolder/*
to
http://newdomain.com/newfolder/*
currently using following:
rewriteengine on rewritebase / rewritecond %{http_host} ^www\.olddomain\.com$ rewriterule (.*) http://newdomain.com/newfolder/$1 [l,r=301]
this works www.olddomain.com not olddomain.com. what's best way achieve this?
help.
replace code this:
options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{http_host} ^(www\.)?olddomain\.com$ [nc] rewriterule ^oldfolder/(.*)$ http://newdomain.com/newfolder/$1 [l,r=301,nc]
Comments
Post a Comment