Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Default HTTPS as separate folder? Can I set this?

    Hey, I am noticing through the demos etc that HTTPS and HTTP data are in the same folder... Is there a way to separate them? I need to because I have an intranet type site that has a separate Http site and https site and I want to keep it this way.

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Default

    I kind of need to know this soon because I need to get a new server up and running within the next ~week...

  3. #3
    Member apscinsspl's Avatar
    Join Date
    Mar 2008
    Posts
    112

    Default

    Http and https have the same document root in httpd.conf and contents are stored in same folder .

    You might want to try changing the document root in httpd.conf for domain.com:443

  4. #4
    Member
    Join Date
    Dec 2001
    Posts
    746

    Default

    Quote Originally Posted by chewedtoothpick View Post
    Hey, I am noticing through the demos etc that HTTPS and HTTP data are in the same folder... Is there a way to separate them? I need to because I have an intranet type site that has a separate Http site and https site and I want to keep it this way.
    You'll need to have root level access to edit /usr/local/apache/conf/httpd.conf to do this. You should see a configuration set for the domain that looks something like this:

    <VirtualHost xx.xxx.xx.xx:443>
    ServerName yyyyyy.com
    Server Alias www.yyyyyyy.com
    DocumentRoot /home/username/public_html
    ....
    .....
    </VirtualHost>

    Change the DocumentRoot line from /home/username/public_html to the folder that your https site should go to and then close httpd.conf in your editor.

    Then run this command:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    Then restart Apache for the changes to take effect.

    If you do not have root level access to the server and are a domain owner, you'll need to create a file called .htaccess in your public_html directory containing these lines:

    RewriteCond %{SERVER_PORT} 443
    RewriteRule ^/$ /directory_to_send_visitors_to


    This is only valid if the server owner has mod_rewrite enabled in Apache.

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Default

    Quote Originally Posted by cpaneldave View Post
    You'll need to have root level access to edit /usr/local/apache/conf/httpd.conf to do this. You should see a configuration set for the domain that looks something like this:

    <VirtualHost xx.xxx.xx.xx:443>
    ServerName yyyyyy.com
    Server Alias www.yyyyyyy.com
    DocumentRoot /home/username/public_html
    ....
    .....
    </VirtualHost>

    Change the DocumentRoot line from /home/username/public_html to the folder that your https site should go to and then close httpd.conf in your editor.

    Then run this command:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    Then restart Apache for the changes to take effect.

    If you do not have root level access to the server and are a domain owner, you'll need to create a file called .htaccess in your public_html directory containing these lines:

    RewriteCond %{SERVER_PORT} 443
    RewriteRule ^/$ /directory_to_send_visitors_to


    This is only valid if the server owner has mod_rewrite enabled in Apache.
    PERFECT! Exactly what I need. Thank you.

    Is it all possible to set it so that when I create new domains that they automatically have a separate HTTPS folder? I have about 4 domains on my server I want this for.
    Last edited by chewedtoothpick; 12-30-2008 at 07:48 PM.

  6. #6
    Member
    Join Date
    May 2008
    Posts
    1,203

    Default

    I do not think so that you can do it automatically. As Apache will automatically set DocumentRoot as

    /home/username/public_html in /usr/local/apache/conf/httpd.conf when you create a new domain from WHM.

  7. #7
    Registered User
    Join Date
    Jan 2009
    Posts
    2

    Default

    You might want to try changing the document root in httpd.conf for domain.com:443

Similar Threads & Tags
Similar threads

  1. Https - on a single folder
    By mbtmobile in forum New User Questions
    Replies: 0
    Last Post: 12-02-2010, 09:21 AM
  2. Force HTTP and HTTPS use same folder
    By deakhead in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-13-2010, 03:19 PM
  3. How to set up a page to be https (ssl)
    By MZmuda in forum Database Discussions
    Replies: 3
    Last Post: 06-16-2008, 07:55 AM
  4. Separate http and https apache directories
    By alex2005 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-03-2005, 11:55 AM
  5. How it is possible to appoint IP to a separate folder?
    By rip_curl in forum New User Questions
    Replies: 1
    Last Post: 02-03-2005, 06:04 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube