B
B
Boomfar2014-02-22 14:25:39
htaccess
Boomfar, 2014-02-22 14:25:39

How to implement a redirect from all pages of the old domain?

There is a .htaccess that does a 301 redirect from the old domain to the new one:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^([^/]+) $1 [L]

RewriteCond %{HTTP_HOST} ^site\.com
RewriteRule ^(.*)$ http://site.org/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.site\.com
RewriteRule ^(.*)$ http://site.org/$1 [R=301,L]

How can I change it so that the redirect is not from the site.com/123 page to the site.org/123 page, but from all site.com/* pages to the main site.org page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Klementiev, 2014-02-22
@Marques

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^site\.com
RewriteRule ^(.*)$ http://site.org/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www.site\.com
RewriteRule ^(.*)$ http://site.org/ [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question