Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. RewriteOptions inherit
  2. AddHandler application/x-httpd-php53 .php .php5 .php4 .php3
  3.  
  4. ##
  5. # @package Joomla
  6. # @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
  7. # @license GNU General Public License version 2 or later; see LICENSE.txt
  8. ##
  9.  
  10. ##
  11. # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
  12. #
  13. # The line just below this section: 'Options +FollowSymLinks' may cause problems
  14. # with some server configurations. It is required for use of mod_rewrite, but may already
  15. # be set by your server administrator in a way that dissallows changing it in
  16. # your .htaccess file. If using it causes your server to error out, comment it out (add # to
  17. # beginning of line), reload your site in your browser and test your sef url's. If they work,
  18. # it has been set by your server administrator and you do not need it set here.
  19. ##
  20.  
  21. ## Can be commented out if causes errors, see notes above.
  22. Options +FollowSymLinks
  23.  
  24. ## Mod_rewrite in use.
  25.  
  26. RewriteEngine On
  27.  
  28. ##
  29. # Phyton user agent
  30. RewriteCond %{HTTP_USER_AGENT} Python
  31. RewriteRule .* python.html [L]
  32.  
  33.  
  34.  
  35. ## Begin - Rewrite rules to block out some common exploits.
  36. # If you experience problems on your site block out the operations listed below
  37. # This attempts to block the most common type of exploit `attempts` to Joomla!
  38. #
  39. # Block out any script trying to base64_encode data within the URL.
  40. RewriteCond %{QUERY_STRING} base64_encode[^(]*([^)]*) [OR]
  41. # Block out any script that includes a <script> tag in URL.
  42. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  43. # Block out any script trying to set a PHP GLOBALS variable via URL.
  44. RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
  45. # Block out any script trying to modify a _REQUEST variable via URL.
  46. RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
  47. # Return 403 Forbidden header and show the content of the root homepage
  48. RewriteRule .* index.php [F]
  49. #
  50. ## End - Rewrite rules to block out some common exploits.
  51.  
  52. ## Begin - Custom redirects
  53. #
  54. # If you need to redirect some pages, or set a canonical non-www to
  55. # www redirect (or vice versa), place that code here. Ensure those
  56. # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
  57. #
  58. # Redirect to non www
  59. RewriteCond %{HTTP_HOST} ^www.MY-ROOT-DOMAIN.com [NC]
  60. RewriteRule ^(.*)$ http://MY-ROOT-DOMAIN.com/$1 [L,R=301]
  61.  
  62.  
  63.  
  64. # Block idiot sending ReturnUrl
  65. RewriteCond %{QUERY_STRING} ReturnUrl.*
  66. RewriteRule .* index.php [F]
  67. # Block wp-login
  68. #RewriteRule ^(.*)wp-login.php$ index.php [F]
  69. # Block FCKeditor
  70. #RewriteRule ^(.*)fckeditor(.*)$ index.php [NC,F]
  71. # Block ping.ashx
  72. RewriteRule ^(.*)ping.ashx$ index.php [NC,F]
  73. # Send poll request to index.php
  74. #RewriteRule ^(.*)poll_results.aspx$ index.php [R=301,L]
  75. # Send pagenotfound to removed-content
  76. #RewriteRule ^(.*)pagenotfound.aspx$ content-removed [R=301,L]
  77.  
  78.  
  79. #301 Redirect for old store
  80. #301 Redirect old site file to html extension which gets added to Redirect Manager
  81. #where redirects are set
  82. RewriteRule ^(.*.(aspx|doc))$ $1.html [NC,L]
  83. ## End - Custom redirects
  84.  
  85. ##
  86. # Uncomment following line if your webserver's URL
  87. # is not directly related to physical file paths.
  88. # Update Your Joomla! Directory (just / for root).
  89. ##
  90.  
  91. RewriteBase /
  92.  
  93. ## Begin - Joomla! core SEF Section.
  94. #
  95. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  96. #
  97. # If the requested path and file is not /index.php and the request
  98. # has not already been internally rewritten to the index.php script
  99. RewriteCond %{REQUEST_URI} !^/index.php
  100. # and the request is for something within the component folder,
  101. # or for the site root, or for an extensionless URL, or the
  102. # requested URL ends with one of the listed extensions
  103. RewriteCond %{REQUEST_URI} /component/|(/[^.]*|.(php|html?|feed|pdf|vcf|raw))$ [NC]
  104. # and the requested path and file doesn't directly match a physical file
  105. RewriteCond %{REQUEST_FILENAME} !-f
  106. # and the requested path and file doesn't directly match a physical folder
  107. RewriteCond %{REQUEST_FILENAME} !-d
  108. # internally rewrite the request to the index.php script
  109. RewriteRule .* index.php [L]
  110. #
  111. ## End - Joomla! core SEF Section.
  112.  
  113. <IfModule mod_security.c>
  114. SecFilterRemove 00393
  115. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement