V
V
Vlad2019-05-14 16:57:17
htaccess
Vlad, 2019-05-14 16:57:17

What is a 400 error due to htaccess?

For some reason, after adding this redirect to htacces:

RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
RewriteCond %{REQUEST_URI} !^/robots\.txt 
RewriteCond %{REQUEST_METHOD} !POST 
RewriteRule !(^$|.*\.(css|jpg|gif|ico|png)) / [R=301,L]

when opening a non-existent page, for example, example.com/sf4re4rs , it does not open Home, but example.com:443
Please tell me how to fix it?
Here is the htaccess in full:
RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !^/robots\.txt
RewriteCond %{REQUEST_URI} !^/tootasapind\.html
RewriteCond %{REQUEST_METHOD} !POST
RewriteRule !(^$|.*\.(css|jpg|gif|ico|png)) / [R=301,L]


RewriteCond %{QUERY_STRING} ^(.+) [NC]
RewriteRule ^(.*)$ /$1? [R=301,L]

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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-05-15
@Sc0undRel

Try specifying the full address instead of /and/$1?

RewriteRule ^(.*)$ https://graniidist.ee/$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