Advertisement
Guest User

Untitled

a guest
Apr 18th, 2011
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement