Skip to content

Instantly share code, notes, and snippets.

@jesse1981
Created May 7, 2013 23:32
Show Gist options
  • Select an option

  • Save jesse1981/5537046 to your computer and use it in GitHub Desktop.

Select an option

Save jesse1981/5537046 to your computer and use it in GitHub Desktop.
Typical htaccess rewrite implementation
RewriteEngine On
RewriteRule ^js - [L,NC]
RewriteRule ^img - [L,NC]
RewriteRule ^css - [L,NC]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/(.*)$ index.php?module=$1&action=$2&id=$3&format=$4 [QSA,L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/(.*)$ index.php?module=$1&action=$2&id=$3 [QSA,L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/(.*)$ index.php?module=$1&action=$2 [QSA,L]
RewriteRule ^(.*)$ index.php?module=$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment