Knowledge Base Glossary   
Search  
   
Browse by Category
Knowledge Base .: Web Programming .: PHP .: ow do I force SSL on my PHP site?

ow do I force SSL on my PHP site?

Below are two samples of what you can use in a .htaccess to force SSL on your PHP4 or PHP5 site:

Force SSL on entire site
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]

Force SSL on a specific directory
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://%{SERVER_NAME}/DIRNAMEHERE [R,L]

How helpful was this article to you?

Related Articles

article How can I test my site before I change DNS?
Within your control panel, we provide a URL...

(No rating)  8-11-2007    Views: 1419   
article How can I view additional information about how PHP is setup on my site?
PHPinfo is a function that returns information...

(No rating)  9-11-2007    Views: 1857   
article How can I define mime types on my Windows/IIS based site?
You can use a web.config file with the...

  9-9-2008    Views: 1336   

User Comments

Add Comment
No comments have been posted.


.: Powered by Lore 1.5.6