TEXT   35

Joomla htaccess

Guest on 17th June 2022 12:59:07 AM

  1. ##
  2. # @package    Joomla
  3. # @copyright  Copyright (C)  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 'Options +FollowSymLinks' may cause problems with some server configurations.
  11. # It is required for the use of mod_rewrite, but it may have already been set by your
  12. # server administrator in a way that disallows changing it in this .htaccess file.
  13. # If using it causes your site to produce an error, comment it out (add # to the
  14. # beginning of the line), reload your site in your browser and test your sef urls. If
  15. # they work, then it has been set by your server administrator and you do not need to
  16. # set it here.
  17. ##
  18.  
  19. ## No directory listings
  20. IndexIgnore *
  21.  
  22. ## Can be commented out if causes errors, see notes above.
  23. Options +FollowSymlinks
  24. Options -Indexes
  25.  
  26. ## Mod_rewrite in use.
  27.  
  28. RewriteEngine On
  29.  
  30. ## Begin - Rewrite rules to block out some common exploits.
  31. # If you experience problems on your site then comment out the operations listed
  32. # below by adding a # to the beginning of the line.
  33. # This attempts to block the most common type of exploit `attempts` on Joomla!
  34. #
  35. # Block any script trying to base64_encode data within the URL.
  36. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  37. # Block any script that includes a <script> tag in URL.
  38. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  39. # Block any script trying to set a PHP GLOBALS variable via URL.
  40. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  41. # Block any script trying to modify a _REQUEST variable via URL.
  42. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  43. # Return 403 Forbidden header and show the content of the root home page
  44. RewriteRule .* index.php [F]
  45. #
  46. ## End - Rewrite rules to block out some common exploits.
  47.  
  48. ## Begin - Custom redirects
  49. #
  50. # If you need to redirect some pages, or set a canonical non-www to
  51. # www redirect (or vice versa), place that code here. Ensure those
  52. # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
  53. #
  54. ## End - Custom redirects
  55.  
  56. ##
  57. # Uncomment the following line if your webserver's URL
  58. # is not directly related to physical file paths.
  59. # Update Your Joomla! Directory (just / for root).
  60. ##
  61.  
  62. # RewriteBase /
  63.  
  64. ## Begin - Joomla! core SEF Section.
  65. #
  66. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  67. #
  68. # If the requested path and file is not /index.php and the request
  69. # has not already been internally rewritten to the index.php script
  70. RewriteCond %{REQUEST_URI} !^/index\.php
  71. # and the requested path and file doesn't directly match a physical file
  72. RewriteCond %{REQUEST_FILENAME} !-f
  73. # and the requested path and file doesn't directly match a physical folder
  74. RewriteCond %{REQUEST_FILENAME} !-d
  75. # internally rewrite the request to the index.php script
  76. RewriteRule .* index.php [L]
  77. #
  78. ## End - Joomla! core SEF Section.

Raw Paste


Login or Register to edit or fork this paste. It's free.