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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -