sample.htaccess 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ##############################
  2. # MicroMVC Apache2 settings
  3. ##############################
  4. # 1and1.com users might need to un-comment this line
  5. #AddType x-mapp-php5 .php
  6. # Disable directory browsing
  7. Options All -Indexes
  8. # Prevent folder listing
  9. #IndexIgnore *
  10. # Set the default file for indexes
  11. DirectoryIndex index.php index.html
  12. <IfModule mod_rewrite.c>
  13. # mod_rewrite rules
  14. RewriteEngine on
  15. # The RewriteBase of the system (change if you are using this sytem in a sub-folder).
  16. RewriteBase /
  17. # If the file/dir does not exist, route everything to index.php
  18. RewriteCond %{REQUEST_FILENAME} !-f
  19. RewriteCond %{REQUEST_FILENAME} !-d
  20. RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico)
  21. RewriteRule ^(.*)$ index.php/$1 [QSA,L]
  22. #############################
  23. # Prevent Image hotlinking (must be blank refer or this site)
  24. #RewriteCond %{HTTP_REFERER} !^$
  25. #RewriteCond %{HTTP_REFERER} !^http://(micromvc|othersite) [NC]
  26. #RewriteRule .*\.(gif|jpg|png)$ [NC,F]
  27. #############################
  28. # Deny any people (or bots) from the following sites: (to stop spam comments)
  29. #RewriteCond %{HTTP_REFERER} nienschanz\.ru [NC,OR]
  30. #RewriteCond %{HTTP_REFERER} porn\.com
  31. #RewriteRule .* - [F]
  32. # You can also uncomment this if you know the IP:
  33. #Deny from 192.168.1.1
  34. </IfModule>
  35. # Cache static content for one week
  36. #<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
  37. # #Header set Cache-Control "max-age=604800"
  38. #</FilesMatch>