Genadinik
Genadinik

Reputation: 18649

.htaccess to Redirect all Pages to one Domain

I have one site that I never perused and I might as well redirect all pages there to my current project. I am currently able to redirect to a mirror url, which means only the home page redirects to the new home page.

But how can I do it so that all the pages on the old site redirect to http://www.comehike.com

Here is my current .htaccess file

Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*) http://www.comehike.com/$1 [R=301,L]

Thanks, Alex

Upvotes: 0

Views: 2119

Answers (2)

user681420
user681420

Reputation: 11

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?old\.com
RewriteRule (.*) http://www.new.com/$1 [R=301,L]

Upvotes: 0

Edward Z. Yang
Edward Z. Yang

Reputation: 26752

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^old-domain.com [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301]

Upvotes: 2

Related Questions