I have this server with multiple domains running CentOS 6.2 and Apache. This server has a SSL certificate installed and working well.
Every time I browse to the main domain, without adding http:// it shows the https part.
For example:
If I type mydomain.com
it shows the https page on private_html/index.html
instead of public_html/index.html
If I type http://mydomain.com or http://www.mydomain.com
it shows the correct page at public_html/index.html
If I type https://mydomain.com or https://www.mydomain.com
it shows the correct page at private_html/index.html
the problem is just that if I omit the http or https part it always shows the https part. I want the inverse. I want to go to https when I want, not when apache wants.
What may be causing this?
This is my httpd.conf for this domain
<VirtualHost 100.101.102.103:80 >
ServerName www.mysite.com
ServerAlias www.mysite.com mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /home/admin/domains/mysite.com/public_html
ScriptAlias /cgi-bin/ /home/admin/domains/mysite.com/public_html/cgi-bin/
UseCanonicalName OFF
<IfModule !mod_ruid2.c>
SuexecUserGroup admin admin
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups apache access
</IfModule>
CustomLog /var/log/httpd/domains/mysite.com.bytes bytes
CustomLog /var/log/httpd/domains/mysite.com.log combined
ErrorLog /var/log/httpd/domains/mysite.com.error.log
<Directory /home/admin/domains/mysite.com/public_html>
Options +Includes -Indexes
php_admin_flag safe_mode OFF
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@mysite.com'
php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
</Directory>
</VirtualHost>
<VirtualHost 100.101.102.103:443 >
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
ServerName www.mysite.com
ServerAlias www.mysite.com mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /home/admin/domains/mysite.com/private_html
ScriptAlias /cgi-bin/ /home/admin/domains/mysite.com/public_html/cgi-bin/
UseCanonicalName OFF
<IfModule !mod_ruid2.c>
SuexecUserGroup admin admin
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups apache access
</IfModule>
CustomLog /var/log/httpd/domains/mysite.com.bytes bytes
CustomLog /var/log/httpd/domains/mysite.com.log combined
ErrorLog /var/log/httpd/domains/mysite.com.error.log
<Directory /home/admin/domains/mysite.com/private_html>
Options +Includes -Indexes
php_admin_flag safe_mode OFF
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@mysite.com'
php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
</Directory>
</VirtualHost>
any help is appreciated. Thanks.
