A
A
Alexander AS2019-04-16 15:27:57
MODX
Alexander AS, 2019-04-16 15:27:57

When setting up .htaccess, why did it start redirecting to example.com/?

Good day to all!
When setting up a redirect in .htaccess, it began to redirect to example.com/.
Why?
I wanted to make it so that the user could follow the link both from the https protocol and from www
Removed the bars here

# without www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com [NC]
RewriteRule (.*) http://example.com/$1 [R=301,L]

and put a link to your site
# without www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^quest.ra-sn\.ru [NC]
RewriteRule (.*) https://quest.ra-sn.ru/$1 [R=301,L]

After that, as if stuck, I returned the grids as it was originally, but still transfers to example.com
Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Tarasov, 2019-04-16
@an-tar

Possibly browser cache, check actual redirects under incognito mode in chrome or here: www.redirect-checker.org

V
Valentin, 2019-04-16
@romanko_vn

Everything is fine with you, apparently the cache is just

http://quest.ra-sn.ru/
301 Moved Permanently
https://quest.ra-sn.ru/
200 OK

V
Viktor Taran, 2019-04-16
@shambler81

1. who will screen for you?
2. you need
www\.(.+) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] ]
3.
You have a redirect cache, there are a lot of manovs on the Internet how to disable it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question