.htaccess - htaccess redirect specific page of specific domains to specific pages -
i have created new wordpress site replace multi-domain website. server redirections has been done on different domains point of them same path.
i need redirect pages based on parent domain , also, redirect specific domain pages new specific domain pages .
for example, when "www.mysite-example.com.au/contact" requested should redirect "mysite.com.au/contact-us" , "www.mysite-example.com.au/contact/form" should redirect "mysite-example.com.au/request-contact-form"
here current htaccess i'm doing global redirection
options +followsymlinks rewriteengine on rewritecond %{http_host} ^www.abilitypeople.com$ [nc] rewriterule ^(.*)$ http://abilitypeople.co.uk/ [r=301,l] rewritecond %{http_host} ^www.abilitypeople.co.uk$ [nc] rewriterule ^(.*)$ http://abilitypeople.co.uk/ [r=301,l] rewritecond %{http_host} ^www.abilitypeople.com.au$ [nc] rewriterule ^(.*)$ http://abilitypeople.com.au/ [r=301,l] # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress
does 1 know how create these redirections on same htacces
"www.mysite-example.com.au/contact" -> "mysite.com.au/contact-us" "www.mysite-example.com.au/contact/form" -> "mysite-example.com.au/request-contact-form" "www.mysite-example.co.uk/contact" -> "mysite.co.uk/contact-us" "www.mysite-example.co.uk/contact/form" -> "mysite-example.co.uk/request-contact-form"
by way, anubhava help
you can have rules this:
options +followsymlinks -multiviews rewriteengine on rewritecond %{http_host} ^(www\.)?abilitypeople\.com$ [nc] rewriterule ^ http://abilitypeople.co.uk%{request_uri} [r=301,l,ne] rewritecond %{http_host} ^www\.(abilitypeople\.(?:co\.uk|com\.au))$ [nc] rewriterule ^ http://%1%{request_uri} [r=301,l,ne] rewriterule ^contact/?$ contact.php [l,qsa]
Comments
Post a Comment