Created
August 30, 2015 02:28
-
-
Save lambdacpp/b91449b367d55bcacde2 to your computer and use it in GitHub Desktop.
nginx_htaccess
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
| # removes trailing slashes (prevents SEO duplicate content issues) | |
| if (!-d $request_filename) | |
| { | |
| rewrite ^/(.+)/$ /$1 permanent; | |
| } | |
| # removes trailing "index" from all controllers | |
| if ($request_uri ~* index/?$) | |
| { | |
| rewrite ^/(.*)/index/?$ /$1 permanent; | |
| } | |
| # unless the request is for a valid file (image, js, css, etc.), send to bootstrap | |
| if (!-e $request_filename) | |
| { | |
| rewrite ^/(.*)$ /index.php?/$1 last; | |
| break; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment