wordpress - Redirecting whole website by htaccess -
i using wordpress , trying redirect whole website new domain. want website structure remain same in way:
"www.domain.com" redirected to "www.domain.ca"
"www.domain.com/post1" redirected "www.domain.ca/post1"
as site of wordpress htaccess has commands. haven't changed commands added more site home page starts redirects not whole site.according research "rewriterule ^(.*)$ ..." lets whole website redirect unfortunately not. of htaccess code given below. have replaced domain names in code.
old domain:www.domain.com
new domain: www.domain.ca
# 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 rewritecond %{http_host} ^domain\.com$ [or] rewritecond %{http_host} ^www\.domain\.com$ rewriterule ^(.*)$ "http\:\/\/www\.domain\.ca/$1" [r=301,l]
thank you.
Comments
Post a Comment