Advertisement
Guest User

.htaccess

a guest
May 10th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. DirectoryIndex index.html index.php index.htm index.cgi
  2.  
  3. RewriteEngine on
  4.  
  5. #pagination rewriting
  6. RewriteRule ^(.*?)/([0-9]+)/([0-9]+)?$ index.php?page=$2&c_id=$3 [L,QSA]
  7.  
  8. #business review rewriting
  9. RewriteRule ^([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/([0-9]+)/([a-zA-Z0-9-_]+)/?$ contents/details.php?b_id=$4&status=$5 [L,QSA]
  10.  
  11. #business rewriting
  12. RewriteRule ^([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)/([0-9]+)/?$ contents/details.php?b_id=$4 [L,QSA]
  13.  
  14. #claim page rewriting
  15. RewriteRule ^claim/([0-9]+)/?$ contents/claim.php?b_id=$1 [L,QSA]
  16.  
  17. #report page rewriting
  18. RewriteRule ^report/([0-9]+)/?$ contents/report.php?b_id=$1 [L,QSA]
  19.  
  20. #index.php to host
  21. RewriteCond %{THE_REQUEST} ^.*/index\.php
  22. RewriteRule ^(.*)index.php$ /$1 [R=301,L]
  23.  
  24. #rewrite host to index.php
  25. RewriteCond %{THE_REQUEST} ^(.*?)$
  26. RewriteRule ^/?$ index.php [L]
  27.  
  28. #main pages rewriting
  29. RewriteCond %{REQUEST_FILENAME} !-f
  30. RewriteCond %{REQUEST_FILENAME}.php !-f
  31.  
  32. RewriteRule ^(.*?)/?$ contents/$1.php
  33.  
  34. #Redirect 301 / http://www.star-business-directory.com/contents/about.php
  35.  
  36. #category rewriting
  37. <IfModule mod_rewrite.c>
  38. RewriteEngine On
  39. RewriteBase /
  40. RewriteCond %{REQUEST_FILENAME} -f [OR]
  41. RewriteCond %{REQUEST_FILENAME} -d
  42. RewriteRule ^ - [L]
  43. RewriteRule ^([_0-9a-zA-Z-]+/)?$ [L]
  44. RewriteRule . index.php [L]
  45. </IfModule>
  46.  
  47. # ******************* admin *************************
  48.  
  49. #admin home
  50. RewriteRule ^admin/([0-9]+)/?$ admin/index.php [L,QSA]
  51.  
  52. ErrorDocument 404 contents/notfound.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement