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

هل استفدت من هذا الجواب؟

 أطبع هذا المقال

اقرأ أيضا

Removal of wget generated files

Posted by ladless, 09-19-2008, 03:19 PMHi there. I have several cronjobs set up like the...

/bin Directory

Posted by swurvin, 05-06-2007, 09:12 PMHello. I wonder if anyone has any ideas on how I go about...

Soap question

Posted by paintball12k, 09-21-2008, 04:41 AMDoes anyone know where I can find good articles on...

Linux: backup hard drive mounted to /backup

Posted by UberTricep, 11-10-2012, 07:49 AMI have a new dedicated server and I ordered a backup...

McHost

Posted by avara, 09-27-2001, 04:59 PMI just did a search on McHost, and posts about them seem to...