Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.91 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do i create forwarding for BOTH http and https for my domain hosted on godaddy?
  2. http://mydomain.com -> https://www.mydomain.com
  3. http://www.mydomain.com -> https://www.mydomain.com
  4. https://mydomain.com -> https://www.mydomain.com
  5. https://www.mydomain.com -> https://www.mydomain.com
  6.        
  7. Listen 80
  8. Listen 443
  9. NameVirtualHost *:80
  10. NameVirtualHost *:443
  11.  
  12.  
  13. <VirtualHost *:80>
  14.  
  15.  ServerName www.mydomain.com
  16.  ServerAlias mydomain.com
  17.  #add any more aliases(if any) like mydomain.net ww.mydomain.net
  18.  
  19.  RewriteEngine on
  20.  RewriteRule ^ https://www.mydomain.com%{REQUEST_URI} [L,R=301]
  21.  
  22. </VirtualHost>
  23.  
  24. <VirtualHost *:443>
  25.  
  26.  DocumentRoot /path/to/documentroot
  27.  ServerName www.mydomain.com
  28.  ServerAlias mydomain.com
  29.  
  30.  RewriteEngine on
  31.  RewriteCond %{HTTP_HOST} ^mydomain.com$
  32.  RewriteRule ^ https://www.mydomain.com%{REQUEST_URI} [L,R=301]
  33.  
  34.  #All the other directives pertaining to SSL, logs etc add below
  35.  .
  36.  .
  37.  .
  38.  
  39. </VirtualHost>