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: http versus https
Author
Doug22



Joined: 02 Jun 2013
Posts: 60
Location: Houston TX

PostPosted: Fri 05 Sep '25 3:38    Post subject: http versus https Reply with quote

Not quite an Apache-specific problem so apologies for that, but I am puzzled. I have a website that is SSL certified for https, but my (Hostgator) logs tell me that many people access it with http. All of my links to it are https. You'd think that when they click on one of my links to it, it would default to https. So what's going on? Are there browsers that refuse to use https and default to http?
Back to top
mrdj1024



Joined: 03 Apr 2023
Posts: 73
Location: Bridgeton,NJ,USA

PostPosted: Fri 05 Sep '25 6:33    Post subject: Reply with quote

hi!,you can make an .htaccess file and have it redirect all http requests to https automatically
open a notepad
add the following text to it(copy and paste)

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

------------------------------------------------------------
save it as .htaccess and put it in your main website folder(usually where index.html is)
Back to top
Doug22



Joined: 02 Jun 2013
Posts: 60
Location: Houston TX

PostPosted: Fri 05 Sep '25 14:31    Post subject: Reply with quote

Thank you. That's helpful in keeping things organized. But WHY are many of my requests http? All the links to my site that I advertise are https, so someone clicks on those and ends up connecting by http. There must be some popular browser that INSISTS on connecting by http, or else people somehow explicitly choose to do so.
Back to top
Doug22



Joined: 02 Jun 2013
Posts: 60
Location: Houston TX

PostPosted: Fri 05 Sep '25 15:55    Post subject: Reply with quote

Ah, now that's interesting. The majority of IPs that hit me up with http accesses are identified as being from Russia. Is that understandable?
Back to top
Stray78



Joined: 15 Apr 2024
Posts: 44
Location: USA

PostPosted: Fri 05 Sep '25 22:00    Post subject: Reply with quote

I do this. In my vhost section I redirect...

Code:
<VirtualHost *:80>
   # Server Stuff #
   ServerName webmail.mysite.com
   DocumentRoot "Z:/webmail"
   
   # Logging Stuff #
   CustomLog "Z:/logs/Apache/HTTP/Webmail.log" "combined" env=!dontlog
   
   # HTTPS Redirect #
   Redirect permanent /  https://webmail.mysite.com/

</VirtualHost>
Back to top


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