We Recommend

Pro Apache Pro Apache
In addition to installation, maintenance, and deployment, the book demonstrates how to configure Apache to use Perl, PHP, and Python as server-side scripting languages. And unlike other books on Apache, Pro Apache provides comprehensive information on both major revisions - 1.3 and 2.0 - of the software.


Posted By

luizlopes on 08/12/08


Tagged

url php modrewrite querystring friendly seofriendly


Versions (?)


Who likes this?

1 person has 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.