J
J
Jack OXO2017-07-15 19:06:56
htaccess
Jack OXO, 2017-07-15 19:06:56

How to make a 301 redirect in htaccess from home to home?

Actually, there is such a redirect, from the url of a page of one domain to the url of the same page on another domain:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsite\.com
RewriteRule ^(.*)$ https://newsite.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.oldsite\.com
RewriteRule ^(.*)$ https://newsite/$1 [R=301,L]

Only the main is not redirected, 403 issues. What is the jamb?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-08-01
@shambler81

RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsite\.com
RewriteRule ^(.*)$ https://newsite.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.oldsite\.com
RewriteRule ^(.*)$ https://newsite/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question