Redirect from http to https

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
wlad_wm
Starting out
Posts: 37
Joined: Thu Dec 31, 2009 7:26 pm

Redirect from http to https

Post by wlad_wm » Thu Jul 04, 2019 9:17 pm

Hi!
I configured Web Server + Virtual Hosts:
1) Admin HTTP Port = 8084
2) Admin HTTPS Port = 8081
3) Web Server HTTP Port = 80
4) Web Server HTTPS Port 443
5) Virtual Host 1: mysite.com, http, 80
6) Virtual Host 2: mysite.com, http, 443

I have valid SSL certificates.
Right now I can open mysite.com over HTTP and over HTTPS.
How can I redirect web-link from HTTP to HTTPS?

(in this case all user 's calling http://mysite.com should automaticaly changed to https://mysite.com) ?

dolbyman
Guru
Posts: 16074
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Redirect from http to https

Post by dolbyman » Thu Jul 04, 2019 10:04 pm

really sure you want to expose your web admin to the web ?

lots of hacked units should discourage you

for the other question:

https://www.inmotionhosting.com/support ... ccess-file

wlad_wm
Starting out
Posts: 37
Joined: Thu Dec 31, 2009 7:26 pm

Re: Redirect from http to https

Post by wlad_wm » Thu Jul 04, 2019 10:43 pm

I want to close HTTP using of mysite.com and use only HTTPS
my Admin page can be opened only from local LAN

Thanks a lot. I fixed it. Perhaps I made some syntax error before in rewrite rule..

indru
First post
Posts: 1
Joined: Tue Jan 14, 2020 8:33 pm

Re: Redirect from http to https

Post by indru » Tue Jan 14, 2020 8:40 pm

wlad_wm wrote: ↑
Thu Jul 04, 2019 10:43 pm
I want to close HTTP using of mysite.com and use only HTTPS
my Admin page can be opened only from local LAN

Thanks a lot. I fixed it. Perhaps I made some syntax error before in rewrite rule..
Hello,
Can you tell me how you fixed it? I have the exact same issue, I want to remove the Virtual Host for port 80 (http) and only have the one for port 443 (https) available, and whenever users write mydomain.com to be pointed towards the https one. Right now, if I write mydomain.com I get pointed towards the http one (port 80) and I have to manually specify https protocol and port 443 to go to https virtualhost.

How exactly did you manage to redirect to https only?

Thank you!

Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”