Advertisement
Guest User

Untitled

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