C
C
c5c52015-12-10 20:26:30
PHP
c5c5, 2015-12-10 20:26:30

Saving requests over SSL connection?

If the site worked on http and then switched to https, but some requests go to the old address on http (old links, forms from other sites, requests to the API), is it possible to redirect all this to https without damage and give the correct answer so that for external users nothing has changed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2015-12-10
@c5c5

Can. Add a redirect from http to https.
In the case of apache, this can be done by adding the following lines to the virtualhost:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question