Redirect request to other domain

I was trying to redirect all of my one wordpress blog setup which is setup on sub directory to the dedicated wordpress domain. To do so I have added following in directory based blog’s htaccess file:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^example1.com$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-blog/(.*) [NC]
RewriteRule ^(.*)$ http://example2-blog-site.com/%1

RewriteCond %{HTTP_HOST} ^www.example1.com$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-blog/(.*) [NC]
RewriteRule ^(.*)$ http://www.example2-blog-site.com/%1

Advertisement

2 responses to this post.

  1. Thanks for making my morning a little bit better with this great article!!

    Reply

  2. very well

    information you write it very clean. I’m very lucky to get this information from you.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.