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

Ця відповідь Вам допомогла?

 Роздрукувати цю статтю

Також прочитайте

Premature data download disconnections from server. Challanging one!

Posted by astounding, 05-06-2007, 07:41 AMHi folks, Recently our network of servers all started...

Bind an IP to a UID?

Posted by zawk, 06-22-2008, 11:34 AMI Finally had a question worth asking so I signed up......

Any security risks with setting up server on home network?

Posted by Papa G, 06-28-2008, 04:09 PMAny security risks with setting up server on home network?...

preventing hotlinking of images

Posted by AtoZ, 09-15-2007, 01:38 AMThe images I am trying to block are on page generated by a...

Apache and extensions

Posted by attroll, 01-14-2008, 12:01 AMI have found a hole in one of my servers that someone else...