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

Byla tato odpověď nápomocná?

 Tisknout tento článek

Také čtěte

How to post vars to an external gateway?

Posted by cnapsys, 09-21-2008, 10:05 PMHi guys, I need to send some variables to an external...

How can I detect what country is the visitor from?

Posted by bx510, 09-18-2008, 10:46 PMI need to detect where the visitor is coming from on my...

How many daily signups?

Posted by Franki, 09-05-2002, 12:54 PMHello resellers. How many -in average- daily sign-ups do...

Cloudflare - too good to be true?

Posted by UberTricep, 11-02-2012, 08:24 AMSo I've been testing out cloud flare (for free) and it...

data base creator?..

Posted by warlock-m, 02-20-2011, 05:35 PMHello, I'm seeking for a good framework, or simple...