regex - How to redirect a URL by only changing the domain name, while keeping other URL parameters -


i'm migrating website new host , domain, , want know if can redirect enters url of old website new website, while keeping of url parameters. example:

when types in url http://www.domaina.com/blog/?p=667, want him redirected http://www.domainb.com/blog/?p=667.

is there way can adding .htaccess configurations?

thanks!

try in .htaccess file:

options +followsymlinks -multiviews rewriteengine on  # http rewritecond %{http_host} ^(www\.)?domaina\.com$ [nc] rewritecond %{server_port} =80 rewriterule ^(.*)$ http://www.domainb.com/$1 [r=301,l]  # https rewritecond %{http_host} ^(www\.)?domaina\.com$ [nc] rewritecond %{server_port} =443 rewriterule ^(.*)$ https://www.domainb.com/$1 [r=301,l] 

this preserve uri while redirecting domaina domainb.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -