Skip to content

Instantly share code, notes, and snippets.

@MattRead
Created October 3, 2014 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattRead/33174bbd8481e267add4 to your computer and use it in GitHub Desktop.
Save MattRead/33174bbd8481e267add4 to your computer and use it in GitHub Desktop.
something wrong?
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^(archives|blog)/[0-9]+/[0-9]+/(.+)$ $2 [R=301,L]
RewriteRule ^(2005|2004|2006)/[0-9]+/(.+)$ $2 [R=301,L]
RewriteRule ^(css/flag\.php)$ examples/$1 [R=301,L]
RewriteRule ^(projects)/(.+) http://drunkenmonkey.org/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteBase /
RewriteRule . index.php [PT]
RewriteRule ^(system/(classes|locale|schema|$)) index.php [PT]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment