Posted By

onefastsnail on 05/24/12


Tagged


Versions (?)

htaccess


 / Published in: Bash
 

  1. #Rewrite Engine on code - MUST BE ACTIVE for rewrites and redirects to work
  2. Options +FollowSymLinks
  3. RewriteEngine on
  4.  
  5. ## Error Handling - Note to preserve error stratus DO NOT use full URLs
  6. ErrorDocument 401 /401.html
  7. ErrorDocument 403 /403.html
  8. ErrorDocument 404 /404.html
  9. ErrorDocument 500 /500.html
  10. ErrorDocument 400 /400.html
  11.  
  12. ## Force a file to download with a "Save As" ##
  13. #AddType application/octet-stream .doc .mov .avi .pdf .xls .mp4
  14.  
  15. #rewrites
  16.  
  17. #admin redirect
  18. RewriteRule ^admin/$ admin/index.php [NC,L]
  19.  
  20. #remove php extension using a trailing forward slash
  21. RewriteRule ^([^\.]+)/$ $1.php [NC,L]
  22.  
  23. #test.php?start=2 test/start/1/
  24. RewriteRule ^([^/]+)/([^/]+)/([0-9]+)/$ $1.php?$2=$3 [NC,L]
  25.  
  26. RewriteRule ^suppliers/([0-9]+)/([^/]+)/$ suppliers.php?id=$1 [NC,L]
  27.  

Report this snippet  

You need to login to post a comment.