S
S
shaman3602019-07-26 11:35:33
htaccess
shaman360, 2019-07-26 11:35:33

How to implement a redirect to https on internal pages?

There is a rule:

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

If I type http://site.ru in the address bar of the browser, then the redirect to https works.
But if I specify an internal page in the address bar, for example site.ru/files/file-manager.html, then, alas, I don’t see a redirect.
Important clarification: the www prefix is ​​required.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2019-07-26
@Arik

https://github.com/h5bp/server-configs-apache interesting developments
rewrite_http_to_https and rewrite_www
You can also look: https://github.com/phanan/htaccess

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question