logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



redirect traffic http to https ?

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
guido



Joined: 02 Jan 2018
Posts: 1
Location: turin

PostPosted: Tue 02 Jan '18 22:41    Post subject: redirect traffic http to https ? Reply with quote

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: 40
Location: Schömberg, Baden-Württemberg, Germany

PostPosted: Thu 11 Jan '18 0:12    Post subject: Reply with quote

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


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1