Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 18th, 2011  |  syntax: None  |  size: 0.85 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # canonicalize codeigniter url end points
  2. # if your default controller is something other than "welcome" you should change the following
  3. if ($request_uri ~* ^(/page(/index)?|/index(.php)?)/?$)
  4. {
  5.         rewrite ^(.*)$ / permanent;
  6. }
  7.  
  8. # removes trailing "index" from all controllers
  9. if ($request_uri ~* index/?$)
  10. {
  11.         rewrite ^/(.*)/index/?$ /$1 permanent;
  12. }
  13.  
  14. # removes trailing slashes (prevents SEO duplicate content issues)
  15. if (!-d $request_filename)
  16. {
  17.         rewrite ^/(.+)/$ /$1 permanent;
  18. }
  19.  
  20. # removes access to "system" folder, also allows a "System.php" controller
  21. if ($request_uri ~* ^/system)
  22. {
  23.         rewrite ^/(.*)$ /index.php?/$1 last;
  24.         break;
  25. }
  26.  
  27. # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
  28. if (!-e $request_filename)
  29. {
  30.         rewrite ^/(.*)$ /index.php?/$1 last;
  31.         break;
  32. }
  33.  
  34. # catch all
  35. error_page 404 /index.php;
clone this paste RAW Paste Data