.htaccess 3.5 KB

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