Advertisement
nickthegeek

CS htacess

Jun 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. # Modified
  2. # If you modify this file then change the above line to: # Modified
  3.  
  4. <IfModule mod_rewrite.c>
  5. RewriteEngine On
  6.  
  7. ####
  8. # Certain hosts may require the following line.
  9. # If vanilla is in a subfolder then you need to specify it after the /.
  10. # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
  11. ####
  12. RewriteBase /forumnew
  13.  
  14. # Make sure that / doesn't try to go to index.php without a rewrite :)
  15. DirectoryIndex disabled
  16.  
  17. ####
  18. # Deny access to certain directories that SHOULD NOT be exposed.
  19. ####
  20. RewriteRule (^|/)\.git - [L,R=403]
  21. RewriteRule ^cache/ - [L,R=403]
  22. RewriteRule ^cgi-bin/ - [L,R=403]
  23. RewriteRule ^uploads/import/ - [L,R=403]
  24. RewriteRule ^vendor/ - [L,R=403]
  25.  
  26. ####
  27. # Prevent access to any php script by redirecting the request to /index.php
  28. # You can add an exception by adding another RewriteCond after this one.
  29. # Example: RewriteCond %{REQUEST_URI} !^/yourscriptname.php$
  30. # You can comment out this section if it causes you problems.
  31. # This is just a nice to have for security purposes.
  32. ####
  33. RewriteCond %{REQUEST_URI} !/index.php$
  34. RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
  35.  
  36. ####
  37. # Redirect any non existing file/directory to /index.php
  38. ####
  39. RewriteCond %{REQUEST_FILENAME} !-f
  40. RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
  41.  
  42. ####
  43. # Add the proper X_REWRITE server variable for rewritten requests.
  44. ####
  45. RewriteCond %{ENV:REDIRECT_X_REWRITE} .+
  46. RewriteCond %{ENV:REDIRECT_X_PATH_INFO} (.+)
  47. RewriteRule ^index\.php - [E=X_REWRITE:1,E=!REDIRECT_X_REWRITE,E=X_PATH_INFO:%1,E=!REDIRECT_X_PATH_INFO,L]
  48. </IfModule>
  49.  
  50. <IfModule mod_headers.c>
  51. <FilesMatch "(?<!embed)\.(css|js|woff|ttf|eot|svg|png|gif|jpeg|jpg|ico|swf)$">
  52. Header set Cache-Control "max-age=315360000"
  53. Header set Expires "31 December 2037 23:59:59 GMT"
  54. </FilesMatch>
  55. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement