Created
April 17, 2011 06:20
-
-
Save clone1018/923799 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Why rewrite URLs? Read this: http://en.wikipedia.org/wiki/Rewrite_engine | |
# Apache (.htaccess or httpd.conf) | |
# Make sure AllowOverride is on for the directory, or put the rewrite rules in httpd.conf | |
# http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule . /index.php [L] | |
# Nginx (nginx.conf) | |
try_files $uri /index.php; | |
# Lighttpd (lighttpd.conf) | |
url.rewrite-once = ( "/(.*)" => "/index.php/$1" ) | |
# More reading: | |
- http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html | |
- http://wiki.nginx.org/HttpRewriteModule | |
- http://wiki.nginx.org/Pitfalls | |
Note: Thanks to James (http://github.com/jamesvl) for his improvements and fixes (http://gist.github.com/910325) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment