maxt8882017-09-27 15:50:42
maxt888, 2017-09-27 15:50:42

301 redirect returns 303, why?

Good day to all! A question arose, I set up a 301 redirect from http to https and also from www.site.com.ua to site.com.ua. Everything works fine, the redirect in the address bar works fine, but when checking mainspy.ru/answer_servera, a URL like (http, https) site.com.ua gives a 303 redirect, and a URL like www.site.com.ua gives a 301. How to fix to give a 301 redirect instead of a 303?
Here is the code:

RewriteEngine On
AddDefaultCharset UTF-8

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

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Viktor Taran, 2017-09-28

1. give the site itself, I'll check the headings.
2. Also, do not forget that you need to watch not the last answer, but the entire sequence, use a service that watches not only the last one, but the entire series.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question