Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. ##
  2. # @package Joomla
  3. # @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
  4. # @license GNU General Public License version 2 or later; see LICENSE.txt
  5. ##
  6.  
  7. ##
  8. # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
  9. #
  10. # The line just below this section: 'Options +FollowSymLinks' may cause problems
  11. # with some server configurations. It is required for use of mod_rewrite, but may already
  12. # be set by your server administrator in a way that dissallows changing it in
  13. # your .htaccess file. If using it causes your server to error out, comment it out (add # to
  14. # beginning of line), reload your site in your browser and test your sef url's. If they work,
  15. # it has been set by your server administrator and you do not need it set here.
  16. ##
  17.  
  18. ## Can be commented out if causes errors, see notes above.
  19. Options +FollowSymLinks
  20.  
  21.  
  22. <ifModule mod_expires.c>
  23. ExpiresActive On
  24. #по умолчанию кеш в 5 секунд
  25. ExpiresDefault "access plus 5 seconds"
  26. #кэшировать флэш и изображени¤ на мес¤ц
  27. ExpiresByType image/x-icon "access plus 2592000 seconds"
  28. ExpiresByType image/jpeg "access plus 2592000 seconds"
  29. ExpiresByType image/png "access plus 2592000 seconds"
  30. ExpiresByType image/gif "access plus 2592000 seconds"
  31. ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  32. #кэшировать css, javascript и текстовые файлы на одну неделю
  33. ExpiresByType text/css "access plus 604800 seconds"
  34. ExpiresByType text/javascript "access plus 604800 seconds"
  35. ExpiresByType application/javascript "access plus 604800 seconds"
  36. ExpiresByType application/x-javascript "access plus 604800 seconds"
  37. #кэшировать html и htm файлы на один день
  38. ExpiresByType text/html "access plus 43200 seconds"
  39. #кэшировать xml файлы на дес¤ть минут
  40. ExpiresByType application/xhtml+xml "access plus 600 seconds"
  41. </ifModule>
  42.  
  43. ## Mod_rewrite in use.
  44.  
  45. RewriteEngine On
  46.  
  47.  
  48. ## Begin - Rewrite rules to block out some common exploits.
  49. # If you experience problems on your site block out the operations listed below
  50. # This attempts to block the most common type of exploit `attempts` to Joomla!
  51. #
  52. # Block out any script trying to base64_encode data within the URL.
  53. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  54. # Block out any script that includes a <script> tag in URL.
  55. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  56. # Block out any script trying to set a PHP GLOBALS variable via URL.
  57. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  58. # Block out any script trying to modify a _REQUEST variable via URL.
  59. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  60. # Return 403 Forbidden header and show the content of the root homepage
  61. RewriteRule .* index.php [F]
  62. #
  63. ## End - Rewrite rules to block out some common exploits.
  64.  
  65. ## Begin - Custom redirects
  66. #
  67. #
  68. ## End - Custom redirects
  69.  
  70. ##
  71. # Uncomment following line if your webserver's URL
  72. # is not directly related to physical file paths.
  73. # Update Your Joomla! Directory (just / for root).
  74. ##
  75.  
  76. # RewriteBase /
  77.  
  78. ## Begin - Joomla! core SEF Section.
  79. #
  80. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  81. #
  82. # If the requested path and file is not /index.php and the request
  83. # has not already been internally rewritten to the index.php script
  84. RewriteCond %{REQUEST_URI} !^/index\.php
  85. # and the request is for something within the component folder,
  86. # or for the site root, or for an extensionless URL, or the
  87. # requested URL ends with one of the listed extensions
  88. RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
  89. # and the requested path and file doesn't directly match a physical file
  90. RewriteCond %{REQUEST_FILENAME} !-f
  91. # and the requested path and file doesn't directly match a physical folder
  92. RewriteCond %{REQUEST_FILENAME} !-d
  93. # internally rewrite the request to the index.php script
  94. RewriteRule .* index.php [L]
  95. #
  96. ## End - Joomla! core SEF Section.
  97.  
  98. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html|htm|)\ HTTP/
  99. RewriteRule ^(.*)index\.(php|html|htm)$ https://site.ru/$1 [R=301,L]
  100.  
  101. RewriteCond %{REQUEST_URI} (.*/[^/.]+)($|\?)
  102. RewriteRule .* %1/ [R=301,L]
  103. RewriteRule (.*)\.html$ $1 [R=301,L]
  104. RewriteRule (.+)\.html?$ https://site.ru/$1 [R=301,L]
  105.  
  106. <IfModule mod_rewrite.c>
  107. RewriteEngine On
  108. RewriteRule ^/?(.*).(html)$ /$1 [R=301,L]
  109. </IfModule>
  110.  
  111. #www
  112. RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  113. RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
  114. #www
  115.  
  116.  
  117. REDIRECTMATCH 301 ^(.*)\.html$ https://site.ru$1
  118. REDIRECTMATCH 301 ^(.+)/$ https://site.ru$1
  119. #REDIRECTMATCH 301 (.*/[^/.]+)($|\?)$ https://site.ru$1.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement