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 problem |
|
Author |
|
patrickchan
Joined: 19 Jul 2018 Posts: 6 Location: china
|
Posted: Fri 20 Jul '18 9:39 Post subject: redirect problem |
|
|
my web has ssl cert .
when type "http://my_domain.com" it works fine.
but when type "https://my_domain.com" , it will automatically directed to a subdomain ( http://xxx.my_domain.com , which this subdomain is config in my http-ssl.conf , and it is the first VirtualHost in this config file ) .
I amd wonder why the page to be redirected to subdomain .
To fix this problem , the best way is use apache redirect ?
I know apache redirect have many ways to set it as below , would advise which one is better ? thanks
https://httpd.apache.org/docs/2.4/rewrite/remapping.html
The below method is the best ?
<VirtualHost *:80>
ServerName my_domain.com
Redirect / https://my_domain.com
</VirtualHost> |
|
Back to top |
|
maba
Joined: 05 Feb 2012 Posts: 64 Location: Germany, Heilbronn
|
Posted: Mon 23 Jul '18 13:17 Post subject: |
|
|
Actually, the best method is to correct the SSL config.
If you do not use multiple SSL secured sites, you can do all the relevant configurations in ssl.conf.
The Redirect mentioned in your post will redirect HTTP to HTTPS and looks Ok.
The SSL portion does not require VirtualHost if it is just one SSL secured site. |
|
Back to top |
|
|
|
|
|
|