.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]

Cette réponse était-elle pertinente?

 Imprimer cet article

Consultez aussi

CNAME or A record in DNS Zone?

Posted by olddocks, 01-14-2008, 08:14 AMi have just created a dns ZONE for my domain, but i dont...

Plain Text To PNG

Posted by CAB 08, 09-22-2008, 06:33 AMHey, does anyone know a piece of code that can transform...

changing register_globals from .htaccess will cause 500 Error when php run as CGI

Posted by mshannaq, 05-07-2007, 01:44 PMHello, Today I have a customer want to swich the...

Mysql query LIKE%

Posted by net4all, 03-12-2010, 05:32 AMI got a special mysql-problem: I have a table containing...

Where can i use command line instead of gui in cpanel?

Posted by sash_007, 03-09-2010, 08:46 AMHello friends, Just wondering whether i can use...