You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by vi...@tatamotors.com on 2013/03/13 13:59:58 UTC

[users@httpd] How to configure http and https for same hostname

Hi,

 

How to configure http and https for same hostname. Any good document.

 

Regards

Vitthal 

 

********************************************************************************************************************************************************
"This e-Mail may contain proprietary and confidential information and is sentfor the intended recipient(s) only. 
If, by an addressing or transmission error,this mail has been misdirected to you, you are requested to delete this mailimmediately. 
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution
and/or publication of this e-mail message,contents or its attachment(s) other than by its intended recipient(s) is strictly prohibited. 
Any opinions expressed in this email are those of the individual and not necessarily of the organization. 
Before opening attachment(s), please scan for viruses."
********************************************************************************************************************************************************

Re: [users@httpd] How to configure http and https for same hostname

Posted by Chris Gordon <CG...@aires.com>.
Hello,
 
If you are trying to setup so that all requests for either http or https go to https I would use a rewrite rule.  You can use a virtual host for https, listen on both http port and https port and then add a rewrite rule to your httpd.conf.  There are examples that can be found easily, but the documentation is always a great place to start.  Look for documentation on mod_rewrite.
 
Regards,
-Chris 

>>> <vi...@tatamotors.com> 3/13/2013 8:59 AM >>>

Hi,
 
How to configure http and https for same hostname. Any good document.
 
Regards
Vitthal 
 

********************************************************************************************************************************************************
"This e-Mail may contain proprietary and confidential information and is sentfor the intended recipient(s) only. 
If, by an addressing or transmission error,this mail has been misdirected to you, you are requested to delete this mailimmediately. 
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution
and/or publication of this e-mail message,contents or its attachment(s) other than by its intended recipient(s) is strictly prohibited. 
Any opinions expressed in this email are those of the individual and not necessarily of the organization. 
Before opening attachment(s), please scan for viruses."
********************************************************************************************************************************************************
The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited.

Re: [users@httpd] How to configure http and https for same hostname

Posted by Mark Montague <ma...@catseye.org>.
On March 13, 2013 8:59 , <vi...@tatamotors.com> wrote:
>
> How to configure http and https for same hostname. Any good document.
>

You need to have one <VirtualHost> stanza for HTTP, and a second 
<VirtualHost> stanza for HTTPS.  In order to configure them both for the 
same hostname, specify the same ServerName and DocumentRoot in both 
<VirtualHost> stanzas.  That's all.

For more information on setting up Virtual Hosts in Apache HTTP Server 
2.4, see https://httpd.apache.org/docs/2.4/vhosts/   For more 
information about setting up HTTPS, see 
https://httpd.apache.org/docs/2.4/ssl/

--
   Mark Montague
   mark@catseye.org