Redirect base URL to another domain


Sometimes it require to redirect the user if he hits the base url to another page.

e.g.

If the user hits http://www.example.com then it should be redirected to http://www.example.com/welcome.html

For the above you would have to enter the following line in your .htaccess file.

RewriteEngine on

RewriteRule ^$ http://example.com/welcome.html [R=permanent,L]
Advertisements

2 thoughts on “Redirect base URL to another domain

  1. I feel this is among the such a lot vital information for me. And i am satisfied reading your article. But should observation on some general things, The site style is perfect, the articles is in point of fact great : D. Excellent task, cheers

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 )

Google+ photo

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

Connecting to %s