How To Redirect to https in Apache Using mod_rewrite

Author: , November 17th, 2017

1 2 3 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

How To Make SEO-Friendly URLs Using Apache mod_rewrite And PHP

Author: , December 15th, 2011

Below information copied without permission from Josh Sharp’s site because it is too valuable to lose – great work Josh, and THANKS! 1 2 3 4 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] Note: Only rewrite if the […]

How To Force Apache To Use https

Author: , October 26th, 2011

1 2 3 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

How To Force Apache To Use www In The Domain Name

Author: , April 19th, 2011

1 2 3 4 RewriteEngine On RewriteCond %{HTTP_HOST} !^www.YourDomain.com RewriteCond %{HTTP_HOST} !^$ RewriteRule ^.*$ http://www.YourDomain.com%{REQUEST_URI} [R=301,L] RewriteEngine On RewriteCond %{HTTP_HOST} !^www.YourDomain.com RewriteCond %{HTTP_HOST} !^$ RewriteRule ^.*$ http://www.YourDomain.com%{REQUEST_URI} [R=301,L]