Apache .htaccess Redirects

Posted on Aug 11, 2009

Redirects

Standard redirect:

Redirect 301 /old/url.html http://www.example.com/new/url.html

Redirecting non-https to https:

RewriteEngine On

RewriteCond %{HTTPS} !on

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}