Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


 

We can achieve this using mod_rewrite which is already compiled into your Apache web server here at GlowHost.com

This will redirect any access to the non-secure site to the secure site at https://yourdomain.com

Info

Make sure you have an SSL certificate for your domain!

 


Stick this in your .htaccess file:

 


Code Block
languagetext
RewriteEngine On 
RewriteCond %{SERVER_PORT} !^443$ 
RewriteRule (.*) https://yourdomain.com/$1 [L]

 


If you want to simply redirect all requests for a certain directory, for example your shopping cart installation, you can do something like:

 


Code Block
languagetext
RewriteEngine On 
RewriteCond %{REQUEST_URI} ^/cart/.*
RewriteCond %{SERVER_PORT} !^443$ 
RewriteRule (.*) https://yourdomain.com/ [L]

 

 

 




Content by Label
showLabelsfalse
max5
spacesGKB
showSpacefalse
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel in ("ssl","http","https","redirect","mod_rewrite") and type = "page" and space = "GKB"
labelsHTTP HTTPS mod_rewrite SSL redirect

Page properties
hiddentrue


Related issues