ht.access 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. RewriteEngine On
  11. RewriteBase /
  12. # Prevent dot directories (hidden directories like .git) to be exposed to the public
  13. # Except for the .well-known directory used by LetsEncrypt a.o
  14. RewriteRule "/\.|^\.(?!well-known/)" - [F]
  15. # Rewrite www.example.com -> example.com -- used with SEO Strict URLs plugin
  16. #RewriteCond %{HTTP_HOST} .
  17. #RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
  18. #RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
  19. #
  20. # or for the opposite example.com -> www.example.com use the following
  21. # DO NOT USE BOTH
  22. #
  23. #RewriteCond %{HTTP_HOST} !^$
  24. #RewriteCond %{HTTP_HOST} !^www\. [NC]
  25. #RewriteCond %{HTTP_HOST} (.+)$
  26. #RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L] .
  27. # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
  28. # https://www.example.com when your cert only allows https://secure.example.com
  29. #RewriteCond %{SERVER_PORT} !^443
  30. #RewriteRule (.*) https://example.com/$1 [R=301,L]
  31. # Redirect the manager to a specific domain - don't rename the ht.access file
  32. # in the manager folder to use this this rule
  33. #RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
  34. #RewriteCond %{REQUEST_URI} ^/manager [NC]
  35. #RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
  36. # The Friendly URLs part
  37. RewriteCond %{REQUEST_FILENAME} !-f
  38. RewriteCond %{REQUEST_FILENAME} !-d
  39. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  40. # Make sure .htc files are served with the proper MIME type, which is critical
  41. # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
  42. #AddType text/x-component .htc
  43. # If your server is not already configured as such, the following directive
  44. # should be uncommented in order to set PHP's register_globals option to OFF.
  45. # This closes a major security hole that is abused by most XSS (cross-site
  46. # scripting) attacks. For more information: http://php.net/register_globals
  47. #
  48. # To verify that this option has been set to OFF, open the Manager and choose
  49. # Reports -> System Info and then click the phpinfo() link. Do a Find on Page
  50. # for "register_globals". The Local Value should be OFF. If the Master Value
  51. # is OFF then you do not need this directive here.
  52. #
  53. # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
  54. #
  55. # Your server does not allow PHP directives to be set via .htaccess. In that
  56. # case you must make this change in your php.ini file instead. If you are
  57. # using a commercial web host, contact the administrators for assistance in
  58. # doing this. Not all servers allow local php.ini files, and they should
  59. # include all PHP configurations (not just this one), or you will effectively
  60. # reset everything to PHP defaults. Consult www.php.net for more detailed
  61. # information about setting PHP directives.
  62. #php_flag register_globals Off
  63. # For servers that support output compression, you should pick up a bit of
  64. # speed by un-commenting the following lines.
  65. #php_flag zlib.output_compression On
  66. #php_value zlib.output_compression_level 5
  67. # The following directives stop screen flicker in IE on CSS rollovers. If
  68. # needed, un-comment the following rules. When they're in place, you may have
  69. # to do a force-refresh in order to see changes in your designs.
  70. #ExpiresActive On
  71. #ExpiresByType image/gif A2592000
  72. #ExpiresByType image/jpeg A2592000
  73. #ExpiresByType image/png A2592000
  74. #BrowserMatch "MSIE" brokenvary=1
  75. #BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
  76. #BrowserMatch "Opera" !brokenvary
  77. #SetEnvIf brokenvary 1 force-no-vary