Guest User

SPPageBuilder HTACCESS | Place main redirect before Joomla SEF!

a guest
Jun 14th, 2021
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RewriteEngine On
  2.  
  3. # Rewrite domain.com requests with no subdomain to www.domain.com
  4. RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
  5. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
  6.  
  7. ## Begin - Rewrite rules to block out some common exploits.
  8. # If you experience problems on your site then comment out the operations listed
  9. # below by adding a # to the beginning of the line.
  10. # This attempts to block the most common type of exploit `attempts` on Joomla!
  11. #
  12. # Block any script trying to base64_encode data within the URL.
  13. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  14. # Block any script that includes a <script> tag in URL.
  15. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  16. # Block any script trying to set a PHP GLOBALS variable via URL.
  17. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  18. # Block any script trying to modify a _REQUEST variable via URL.
  19. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  20. # Return 403 Forbidden header and show the content of the root home page
  21. RewriteRule .* index.php [F]
  22. #
  23. ## End - Rewrite rules to block out some common exploits.
  24.  
  25. ## Begin - Custom redirects
  26. #
  27. # If you need to redirect some pages, or set a canonical non-www to
  28. # www redirect (or vice versa), place that code here. Ensure those
  29. # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
  30. #
  31. ## End - Custom redirects
  32.  
  33. ##
  34. # Uncomment the following line if your webserver's URL
  35. # is not directly related to physical file paths.
  36. # Update Your Joomla! Directory (just / for root).
  37. ##
  38.  
  39. # RewriteBase /
  40.  
  41. ## Begin - Joomla! core SEF Section.
  42. #
  43. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  44. #
  45. # If the requested path and file is not /index.php and the request
  46. # has not already been internally rewritten to the index.php script
  47. RewriteCond %{REQUEST_URI} !^/index\.php
  48. # and the requested path and file doesn't directly match a physical file
  49. RewriteCond %{REQUEST_FILENAME} !-f
  50. # and the requested path and file doesn't directly match a physical folder
  51. RewriteCond %{REQUEST_FILENAME} !-d
  52. # internally rewrite the request to the index.php script
  53. RewriteRule .* index.php [L]
  54. #
  55. ## End - Joomla! core SEF Section.
Add Comment
Please, Sign In to add comment