logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


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

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: redirect traffic http to https ?
Author
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: 152
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


Reply to topic   Topic: redirect traffic http to https ? View previous topic :: View next topic
Post new topic   Forum Index -> Apache