×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Apache
Posted by: Ben Valentine
Added: Jan 9, 2017 8:25 PM
Views: 12
Lines 4 and 5 are very important ensuring that url rewrites do not overwrite existing directories or files.
  1. Options +FollowSymLinks
  2. RewriteEngine On
  3.  
  4. RewriteCond %{SCRIPT_FILENAME} !-d
  5. RewriteCond %{SCRIPT_FILENAME} !-f
  6.  
  7. RewriteRule ^users/(\d+)*$ ./profile.php?id=$1
  8. RewriteRule ^threads/(\d+)*$ ./thread.php?id=$1
  9.  
  10. RewriteRule ^search/(.*)$ ./search.php?query=$1