V
V
vadimstroganov2015-11-10 09:27:18
htaccess
vadimstroganov, 2015-11-10 09:27:18

How to set up a redirect of the entire site, except for 404 responses?

Hello!
I'm redirecting the entire site, but I need pages with a 404(not found) status to not be redirected.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} mysite.com [NC]
RewriteCond %{REQUEST_URI} !^/robots.txt$
RewriteRule ^(.*)$ http://mysite.net/$1 [R=301,L]

Tell me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dim Boy, 2015-11-10
@twix007

ErrorDocument 404 mysite.com/404
ErrorDocument 500 mysite.com/500

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question