Posted By

luizlopes on 08/12/08


Tagged

url php modrewrite querystring friendly seofriendly


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

romanos


Using mod_rewrite On Form Parameters


 / Published in: Apache
 

URL: http://www.talkincode.com/using-mod_rewrite-on-form-parameters-89.html

Great way to use mod_rewrite with friendly URLs and Form

  1. <IfModule mod_rewrite.c>
  2. Options +FollowSymLinks
  3. RewriteEngine On
  4.  
  5. RewriteCond %{REQUEST_URI} /search.php$
  6. RewriteCond %{QUERY_STRING} ^q=([A-Za-z0-9\+]+)&s=Search$
  7. RewriteRule ^(.*)$ /s-%1? [R=301,L]
  8.  
  9. RewriteRule ^s-(.*)$ /search.php?q=$1&s=Search&a=1 [L]
  10. </IfModule>

Report this snippet  

You need to login to post a comment.