Web Hosting Talk







View Full Version : Php ifmodule redirect? Im confused?


GPearce
09-24-2007, 10:50 AM
Hi Everyone
I wanted to ask for some advice, i need a piece of scripting that enables PHP to check if the user is at http://www.domain.com or http://domain.com and then redirect it to https://domain.com . but if they are already on https://domain.com , i need it not to do anything.
I heard something like an ifmodule, but i dont understand it xP

Thanks in advance to whoever decides to help me :)

ThatScriptGuy
09-24-2007, 03:13 PM
Place this in your .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Kevin