Advertisement
nathansuchy

ModX .htaccess

Feb 23rd, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. # MODX supports Friendly URLs via this .htaccess file. You must serve web
  2. # pages via Apache with mod_rewrite to use this functionality, and you must
  3. # change the file name from ht.access to .htaccess.
  4. #
  5. # Make sure RewriteBase points to the directory where you installed MODX.
  6. # E.g., "/modx" if your installation is in a "modx" subdirectory.
  7. #
  8. # You may choose to make your URLs non-case-sensitive by adding a NC directive
  9. # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
  10.  
  11. RewriteEngine On
  12. RewriteBase /
  13.  
  14.  
  15.  
  16. # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
  17. #RewriteCond %{HTTP_HOST} .
  18. #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
  19. #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
  20. #
  21. # or for the opposite domain.com -> www.domain.com use the following
  22. # DO NOT USE BOTH
  23. #
  24. #RewriteCond %{HTTP_HOST} .
  25. #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
  26. #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
  27.  
  28.  
  29.  
  30. # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
  31. # https://www.domain.com when your cert only allows https://secure.domain.com
  32. #RewriteCond %{SERVER_PORT} !^443
  33. #RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]
  34.  
  35.  
  36.  
  37. # The Friendly URLs part
  38. RewriteCond %{REQUEST_FILENAME} !-f
  39. RewriteCond %{REQUEST_FILENAME} !-d
  40. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  41.  
  42.  
  43.  
  44. # Make sure .htc files are served with the proper MIME type, which is critical
  45. # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
  46.  
  47. #AddType text/x-component .htc
  48.  
  49.  
  50.  
  51. # If your server is not already configured as such, the following directive
  52. # should be uncommented in order to set PHP's register_globals option to OFF.
  53. # This closes a major security hole that is abused by most XSS (cross-site
  54. # scripting) attacks. For more information: http://php.net/register_globals
  55. #
  56. # To verify that this option has been set to OFF, open the Manager and choose
  57. # Reports -> System Info and then click the phpinfo() link. Do a Find on Page
  58. # for "register_globals". The Local Value should be OFF. If the Master Value
  59. # is OFF then you do not need this directive here.
  60. #
  61. # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
  62. #
  63. # Your server does not allow PHP directives to be set via .htaccess. In that
  64. # case you must make this change in your php.ini file instead. If you are
  65. # using a commercial web host, contact the administrators for assistance in
  66. # doing this. Not all servers allow local php.ini files, and they should
  67. # include all PHP configurations (not just this one), or you will effectively
  68. # reset everything to PHP defaults. Consult www.php.net for more detailed
  69. # information about setting PHP directives.
  70.  
  71. #php_flag register_globals Off
  72.  
  73.  
  74.  
  75. # For servers that support output compression, you should pick up a bit of
  76. # speed by un-commenting the following lines.
  77.  
  78. #php_flag zlib.output_compression On
  79. #php_value zlib.output_compression_level 5
  80.  
  81.  
  82.  
  83. # The following directives stop screen flicker in IE on CSS rollovers. If
  84. # needed, un-comment the following rules. When they're in place, you may have
  85. # to do a force-refresh in order to see changes in your designs.
  86.  
  87. #ExpiresActive On
  88. #ExpiresByType image/gif A2592000
  89. #ExpiresByType image/jpeg A2592000
  90. #ExpiresByType image/png A2592000
  91. #BrowserMatch "MSIE" brokenvary=1
  92. #BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
  93. #BrowserMatch "Opera" !brokenvary
  94. #SetEnvIf brokenvary 1 force-no-vary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement