Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 1.38 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. PHP mod rewrite can't work correctly [closed]
  2. Options +FollowSymLinks
  3.  
  4. RewriteEngine on
  5. RewriteCond %{REQUEST_URI} /([0-9a-zA-Z]+)$ [NC]
  6. RewriteRule ^(.*) image.php?names[]=%1 [L]
  7.  
  8. RewriteCond %{REQUEST_URI} /([0-9a-zA-Z]+),([0-9a-zA-Z]+)$ [NC]
  9. RewriteRule ^(.*) image.php?names[]=%1&names[]=%2 [L]
  10.  
  11. RewriteCond %{REQUEST_URI} /([0-9a-zA-Z]+),([0-9a-zA-Z]+),([0-9a-zA-Z]+)$ [NC]
  12. RewriteRule ^(.*) image.php?names[]=%1&names[]=%2&names[]=%3 [L]
  13.  
  14. RewriteCond %{REQUEST_URI} /gallery/([0-9a-zA-Z]+)$ [NC]
  15. RewriteRule ^(.*) gallery.php?id[]=%1 [L]
  16.        
  17. RewriteCond %{REQUEST_URI} /gallery/([0-9a-zA-Z]+)$ [NC]
  18. RewriteRule ^(.*) gallery.php?id[]=%1 [L]
  19.        
  20. RewriteCond %{REQUEST_URI} /([0-9a-zA-Z]+)$ [NC]
  21. RewriteRule ^(.*) image.php?names[]=%1 [L]
  22.        
  23. RewriteCond %{REQUEST_URI} ^/([0-9a-zA-Z]+)$ [NC]
  24.        
  25. RewriteCond %{REQUEST_URI} /gallery/([0-9a-zA-Z]+)$ [NC]
  26.        
  27. RewriteCond %{REQUEST_URI} ^/gallery/([0-9a-zA-Z]+)$ [NC]
  28.        
  29. RewriteRule ^/([0-9a-zA-Z]+)$ image.php?names[]=$1 [QSA,NC,L]
  30. RewriteRule ^/([0-9a-zA-Z]+),([0-9a-zA-Z]+)$ image.php?names[]=$1&names[]=$2 [QSA,NC,L]
  31. RewriteRule ^/([0-9a-zA-Z]+),([0-9a-zA-Z]+),([0-9a-zA-Z]+)$ image.php?names[]=$1&names[]=$2&names[]=$3 [QSA,NC,L]
  32. RewriteRule ^/gallery/([0-9a-zA-Z]+)$ gallery.php?id[]=$1 [QSA,NC,L]
  33.        
  34. # Trace:
  35. # (!) file gets big quickly, remove in prod environments:
  36. RewriteLog "/web/logs/mywebsite.rewrite.log"
  37. RewriteLogLevel 9
  38. RewriteEngine On