Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: redirect traffic http to https ? |
|
Author |
|
guido
Joined: 02 Jan 2018 Posts: 1 Location: turin
|
Posted: Tue 02 Jan '18 22:41 Post subject: redirect traffic http to https ? |
|
|
hi,
how can i redirect request from http://domain (without www) to https://domain (without www)?
Is there any changes in .htaccess file?
Thanks |
|
Back to top |
|
mraddi
Joined: 27 Jun 2016 Posts: 152 Location: Schömberg, Baden-Württemberg, Germany
|
Posted: Thu 11 Jan '18 0:12 Post subject: |
|
|
If mod_rewrite is available you may use this .htaccess (or at least you can base your work/engineering on this) which simply redirects all http-requests to https with the same hostname that was used within the user's browser host-header:
Code: | IndexIgnore .ht* */.??* *~ *# */HEADER* */README* */_vti*
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=302,L] |
|
|
Back to top |
|
|
|
|
|
|