.htaccess redirect all pages to https://www

Posted by LJ Host, 07-17-2007, 01:50 PM
Hi guys, I'm not to good with htaccess so I need your help. I am able to find information on the 2 items I am looking for separately but not together. I need all pages on a site to redirect to the www ssl version of the page. so.. http://site.com/anypage.php > https://www.site.com/anypage.php http://www.site.com > https://www.site.com http://site.com/test/test.php > https://www.site.com/test/test.php Thanks so much for your help!

Posted by SparkSupport, 07-17-2007, 02:19 PM
Add this directives to your .htaccess file. ----------------------------------------------- RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R] -----------------------------------------------

Posted by LJ Host, 07-17-2007, 02:29 PM
I see that will force to ssl but will it force to the www version?

Posted by SparkSupport, 07-17-2007, 02:42 PM
Use this one for www. --------------------------- RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://www.site.com/$1 [L,R]

Hjälpte svaret dig?

 Skriv ut denna artikeln

Läs även

Apache not recognising my .php files.

Posted by SuperSub, 06-29-2008, 06:43 AMHey guys, Yesterday I was told by my hosting provider...

javascript dies in php

Posted by ti_nhatrang, 01-17-2008, 06:49 AMHi guys, I can't seem to put this in a echo...

Remount back up hard drive

Posted by Peter_Net, 09-15-2007, 07:41 PMHello, I have a second hard disk for cpanel back up...

Delete files created on a specific date

Posted by Acroplex, 06-28-2008, 08:16 PMIs there a quick shell command to find (inside a...

FTP Question - Limiting types of Access

Posted by webtender, 03-29-2008, 11:17 PMHello, Is it possible to setup ftp accounts that have...