N
N
NePastor2022-01-20 19:06:16
URL Handling
NePastor, 2022-01-20 19:06:16

How to redirect to all pages except one?

I have a redirect from without www to with www

via htaccess

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

How to make it redirect all pages, except for one, on this one page I have a text file that I need to confirm that the site is mine (the site with WWW is not on my hosting, but on a free server where I cannot upload files, and I use my hosting for manage dns records, but I can also upload data there, but if I upload a confirmation txt file, it will redirect to www and the system will not see the file).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NePastor, 2022-01-20
@NePastor

decided
it was necessary to add
RewriteCond %{REQUEST_URI} !^/file\.txt$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question