.htaccess modified


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # secure .htaccess file
  2. <Files .htaccess>
  3. order allow,deny
  4. deny from all
  5. </Files>
  6.  
  7. # Dont list files in index pages
  8. IndexIgnore *
  9.  
  10. # EE 404 page for missing pages
  11. ErrorDocument 404 /index.php?/{ee:404}
  12.  
  13. # Simple 404 for missing files
  14. <FilesMatch "(\.jpe?g|gif|png|bmp)$">
  15. ErrorDocument 404 "File Not Found"
  16. </FilesMatch>
  17.  
  18. RewriteEngine On
  19.  
  20. RewriteBase /
  21.  
  22. # remove the www
  23. RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
  24. RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  25.  
  26. # Add a trailing slash to paths without an extension
  27. RewriteCond %{REQUEST_FILENAME} !-f
  28. RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
  29. RewriteRule ^(.*)$ $1/ [L,R=301]
  30.  
  31. # Remove index.php
  32. # Uses the "include method"
  33. # http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
  34. RewriteCond %{REQUEST_FILENAME} !-f
  35. RewriteCond %{REQUEST_FILENAME} !-d
  36. RewriteRule ^(.*)$ /index.php/$1 [L]
  37.  
  38. # Remove IE image toolbar
  39. <FilesMatch "\.(html|htm|php)$">
  40. Header set imagetoolbar "no"
  41. </FilesMatch>
  42.  
  43. php_value memory_limit 16M

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.