How to redirect all urls to another url through .htaccess?

By | November 16, 2011

If you wish to redirect all the urls from one site to another site’s url, then go through the following rewrite rules in .htaccess files.

For Example …

You want to redirect your old blog site to new domain So you have to include the following rules into old blog site’s .htaccess file; means when some one access the url  it will be redirected to

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc\com\blog
RewriteRule ^(.*)$$1 [R=301,L]
RewriteRule    ^$   [L]
RewriteRule    (.*)$1 [L]

Note: Replace “” equal to your old blog url  and also replace “” equal to your new blog url …

One thought on “How to redirect all urls to another url through .htaccess?

  1. best web hosting

    I do totally share your opinion and I am glad that there are still people who think so. Let’s fight for it,because “Opinions cannot survive if one has no chance to fight for them.”


Leave a Reply

Your email address will not be published. Required fields are marked *