Advertisement
Guest User

My Magento mod_rewrite

a guest
Mar 5th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <IfModule mod_rewrite.c>
  2.  
  3. ############################################
  4. ## enable rewrites
  5.  
  6. Options +FollowSymLinks
  7. RewriteEngine on
  8.  
  9. ############################################
  10. ## you can put here your magento root folder
  11. ## path relative to web root
  12.  
  13. #RewriteBase /magento/
  14.  
  15. ############################################
  16. ## uncomment next line to enable light API calls processing
  17.  
  18. # RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
  19.  
  20. ############################################
  21. ## rewrite API2 calls to api.php (by now it is REST only)
  22.  
  23. RewriteRule ^api/rest api.php?type=rest [QSA,L]
  24.  
  25. ############################################
  26. ## workaround for HTTP authorization
  27. ## in CGI environment
  28.  
  29. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  30.  
  31. ############################################
  32. ## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
  33.  
  34. RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
  35. RewriteRule .* - [L,R=405]
  36.  
  37. ############################################
  38. ## redirect for mobile user agents
  39.  
  40. #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
  41. #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
  42. #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
  43.  
  44. ############################################
  45. ## always send 404 on missing files in these folders
  46.  
  47. RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
  48. ############################################
  49. ## never rewrite for existing files, directories and links
  50.  
  51. RewriteCond %{REQUEST_FILENAME} !-f
  52. RewriteCond %{REQUEST_FILENAME} !-d
  53. RewriteCond %{REQUEST_FILENAME} !-l
  54.  
  55. ############################################
  56. ## rewrite everything else to index.php
  57.  
  58. RewriteCond %{REQUEST_URI} [A-Z]
  59. RewriteRule . ${lc:%{REQUEST_URI}} [R=301,L]
  60.  
  61. RewriteRule .* index.php [L]
  62. RewriteRule ^index.php/(.*)$ [L]
  63.  
  64. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement