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

Помог ли вам данный ответ?

 Распечатать статью

Также читают

Which server should I buy? (Server spec)

Posted by fusionwebhost, 04-22-2009, 10:57 AMGreetings to everyone on this board. I have...

Attacking multicore CPUs (new vulnerability discussion from Slashdot/The Register)

Posted by Lightwave, 09-16-2007, 10:02 AMAttacking multicore CPUs...

Domain names diferent servers.

Posted by shakybaky, 06-26-2008, 02:34 PMhello i have two nix vps's One of the vps is setup and...

Going to start hosting...

Posted by Glexicon, 09-13-2001, 01:23 AMI would be getting rackshack.net servers to start my...

How to go about PCI compliance?

Posted by ramdak5000, 01-14-2008, 09:48 PMI have taken basic security measures on my VPS such as...