Advertisement
tinboye

joomla

Mar 13th, 2017
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. ##
  2. # @package Joomla
  3. # @copyright Copyright (C) 2005 - 2016 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. ## Can be commented out if causes errors, see notes above.
  22. Options +FollowSymlinks
  23. Options -Indexes
  24.  
  25. ## Mod_rewrite in use.
  26.  
  27. RewriteEngine On
  28.  
  29. ########## Begin - Redirect non-www to www
  30. RewriteCond %{HTTP_HOST} !^www\. [NC]
  31. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  32. ## If the above throws an HTTP 500 error, swap [R=301,L] with [R,L]
  33. ########## End - Redirect non-www to www
  34.  
  35. ## Begin - Rewrite rules to block out some common exploits.
  36. # If you experience problems on your site then comment out the operations listed
  37. # below by adding a # to the beginning of the line.
  38. # This attempts to block the most common type of exploit `attempts` on Joomla!
  39. #
  40. # Block any script trying to base64_encode data within the URL.
  41. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  42. # Block any script that includes a <script> tag in URL.
  43. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  44. # Block any script trying to set a PHP GLOBALS variable via URL.
  45. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  46. # Block any script trying to modify a _REQUEST variable via URL.
  47. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  48. # Return 403 Forbidden header and show the content of the root home page
  49. RewriteRule .* index.php [F]
  50. #
  51. ## End - Rewrite rules to block out some common exploits.
  52.  
  53. ## Begin - Custom redirects
  54. #
  55. # If you need to redirect some pages, or set a canonical non-www to
  56. # www redirect (or vice versa), place that code here. Ensure those
  57. # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
  58. #
  59. ## End - Custom redirects
  60.  
  61. ##
  62. # Uncomment the following line if your webserver's URL
  63. # is not directly related to physical file paths.
  64. # Update Your Joomla! Directory (just / for root).
  65. ##
  66.  
  67. RewriteBase /
  68.  
  69.  
  70. ## Begin - Joomla! core SEF Section.
  71. #
  72. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  73. #
  74. # If the requested path and file is not /index.php and the request
  75. # has not already been internally rewritten to the index.php script
  76. RewriteCond %{REQUEST_URI} !^/index\.php
  77. # and the requested path and file doesn't directly match a physical file
  78. RewriteCond %{REQUEST_FILENAME} !-f
  79. # and the requested path and file doesn't directly match a physical folder
  80. RewriteCond %{REQUEST_FILENAME} !-d
  81. # internally rewrite the request to the index.php script
  82. RewriteRule .* index.php [L]
  83. #
  84. ## End - Joomla! core SEF Section.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement