Guest User

Untitled

a guest
Jan 13th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. # Elgg htaccess directives
  2. # Copyright Curverider Ltd 2008-2009
  3. # License http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
  4. # Link http://elgg.org/
  5.  
  6. <Files "htaccess_dist">
  7. order allow,deny
  8. deny from all
  9. </Files>
  10.  
  11. # Don't listing directory
  12. Options -Indexes
  13.  
  14. # Follow symbolic links
  15. Options +FollowSymLinks
  16.  
  17. # Default handler
  18. DirectoryIndex index.php
  19.  
  20. # Turn on expiry
  21. <IfModule mod_expires.c>
  22. ExpiresActive On
  23. ExpiresDefault "access plus 10 years"
  24. </IfModule>
  25.  
  26. # php 5, apache 1 and 2
  27. <IfModule mod_php5.c>
  28. # limit the maximum memory consumed by the php script to 64 MB
  29. php_value memory_limit 64M
  30. # register_globals is deprecated as of PHP 5.3.0 - disable it for security reasons.
  31. php_value register_globals 0
  32. # post_max_size is the maximum size of ALL the data that is POST'ed to php at a time (8 MB)
  33. php_value post_max_size 8388608
  34. # upload_max_filesize is the maximum size of a single uploaded file (5 MB)
  35. php_value upload_max_filesize 5242880
  36. # on development servers, set to 1 to display errors. Set to 0 on production servers.
  37. php_value display_errors 0
  38. </IfModule>
  39.  
  40. # Turn on mod_gzip if available
  41. <IfModule mod_gzip.c>
  42. mod_gzip_on yes
  43. mod_gzip_dechunk yes
  44. mod_gzip_keep_workfiles No
  45. mod_gzip_minimum_file_size 1000
  46. mod_gzip_maximum_file_size 1000000
  47. mod_gzip_maximum_inmem_size 1000000
  48. mod_gzip_item_include mime ^text/.*
  49. mod_gzip_item_include mime ^application/javascript$
  50. mod_gzip_item_include mime ^application/x-javascript$
  51. # Exclude old browsers and images since IE has trouble with this
  52. mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
  53. mod_gzip_item_exclude mime ^image/.*
  54. </IfModule>
  55.  
  56. ## Apache2 deflate support if available
  57. ##
  58. ## Important note: mod_headers is required for correct functioning across proxies.
  59. ##
  60. <IfModule mod_deflate.c>
  61. AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
  62. BrowserMatch ^Mozilla/4 gzip-only-text/html
  63. BrowserMatch ^Mozilla/4\.[0678] no-gzip
  64. BrowserMatch \bMSIE !no-gzip
  65.  
  66. <IfModule mod_headers.c>
  67. Header append Vary User-Agent env=!dont-vary
  68. </IfModule>
  69.  
  70. # The following is to disable compression for actions. The reason being is that these
  71. # may offer direct downloads which (since the initial request comes in as text/html and headers
  72. # get changed in the script) get double compressed and become unusable when downloaded by IE.
  73. SetEnvIfNoCase Request_URI action\/* no-gzip dont-vary
  74. SetEnvIfNoCase Request_URI actions\/* no-gzip dont-vary
  75.  
  76. </IfModule>
  77.  
  78. # Configure ETags
  79. <FilesMatch "\.(jpg|jpeg|gif|png|mp3|flv|mov|avi|3pg|html|htm|swf|js|ico)$">
  80. FileETag MTime Size
  81. </FilesMatch>
  82.  
  83. # Add Proper MIME-Type for Favicon to allow expires to work
  84. AddType image/vnd.microsoft.icon .ico
  85.  
  86. <IfModule mod_rewrite.c>
  87.  
  88. RewriteEngine on
  89.  
  90. # If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
  91. # containing the path from your site root to elgg's root. e.g. If your site is
  92. # http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need
  93. #
  94. #RewriteBase /sites/elgg/
  95. #
  96. # here, only without the # in front.
  97. #
  98. # If you're not running Elgg in a subdirectory on your site, but still getting lots
  99. # of 404 errors beyond the front page, you could instead try:
  100. #
  101. #RewriteBase /
  102.  
  103. RewriteBase /.
  104.  
  105. # In for backwards compatibility
  106. RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/page_handler.php?handler=$1&%{QUERY_STRING}
  107. RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2&%{QUERY_STRING}
  108. RewriteRule ^tag\/(.+)\/?$ engine/handlers/page_handler.php?handler=search&page=$1
  109.  
  110.  
  111. RewriteRule ^action\/([A-Za-z0-9\_\-\/]+)$ engine/handlers/action_handler.php?action=$1&%{QUERY_STRING}
  112.  
  113. RewriteRule ^cache\/(.*)$ engine/handlers/cache_handler.php?request=$1&%{QUERY_STRING}
  114.  
  115. RewriteRule ^services\/api\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/service_handler.php?handler=$1&request=$2&%{QUERY_STRING}
  116.  
  117. RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/?$ engine/handlers/export_handler.php?view=$1&guid=$2
  118. RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4
  119.  
  120. RewriteRule xml-rpc.php engine/handlers/xml-rpc_handler.php
  121. RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_handler.php
  122.  
  123.  
  124. # rule for rewrite module test during install - can be removed after installation
  125. RewriteRule ^rewrite.php$ install.php
  126.  
  127. # Everything else that isn't a file gets routed through the page handler
  128. RewriteCond %{REQUEST_FILENAME} !-d
  129. RewriteCond %{REQUEST_FILENAME} !-f
  130. RewriteRule ^([A-Za-z0-9\_\-]+)$ engine/handlers/page_handler.php?handler=$1 [QSA]
  131.  
  132. RewriteCond %{REQUEST_FILENAME} !-d
  133. RewriteCond %{REQUEST_FILENAME} !-f
  134. RewriteRule ^([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2 [QSA]
  135.  
  136.  
  137. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment