
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 0.91 KB | hits: 17 | expires: Never
How do i create forwarding for BOTH http and https for my domain hosted on godaddy?
http://mydomain.com -> https://www.mydomain.com
http://www.mydomain.com -> https://www.mydomain.com
https://mydomain.com -> https://www.mydomain.com
https://www.mydomain.com -> https://www.mydomain.com
Listen 80
Listen 443
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
#add any more aliases(if any) like mydomain.net ww.mydomain.net
RewriteEngine on
RewriteRule ^ https://www.mydomain.com%{REQUEST_URI} [L,R=301]
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /path/to/documentroot
ServerName www.mydomain.com
ServerAlias mydomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^ https://www.mydomain.com%{REQUEST_URI} [L,R=301]
#All the other directives pertaining to SSL, logs etc add below
.
.
.
</VirtualHost>