Website Scripts And Cloud Tutorials

Redirect URL including query string using htaccess

Byadmin

Dec 31, 2010 ,
Click to rate this tutorial!
[Total: 4 Average: 4]

Redirect URL from one domain to another including query string using .htaccess, very simple.
Create a .htaccess file in the root directory of domain1.com and then add the following lines.That will take care of the rest.
For example
http://www.domain1.com/view.php?id=1&show=2 will get redirected to http://www.domain2.com/view.php?id=1&show=2

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain1.com
Rewriterule ^(.*)$ http://www.domain2.com/$1 [L]

HAPPY NEW YEAR GUYS 🙂 HAVE A GREAT YEAR AHEAD

Click to rate this tutorial!
[Total: 4 Average: 4]

Leave a Reply

Your email address will not be published.