hosting:cms:modx:htaccess

2.13.6.3. Стандартный .htaccess для MODX Revolution

Содержимое стандартного .htaccess для MODX Revolution (GitHub):

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