Jump to content

multiple queries with mod_rewrite (RewriteRule)


cataiin

Recommended Posts

I want to use RewriteRule two times, first to change /page.php?id=1321 to /1321 and second to change /search.php?text=ab aa&page=2 to /search/ab--aa/2 but I don't know how because it has two queries (text and page).

 

Until now, I have this:



RewriteEngine On
RewriteRule ^([0-9]+)$ /page.php?id=$1


 

Also, I want (if it's possible) to allow only letters (uppercase and lowercase) and spaces for text and transform spaces in - or _, and for page I want only numbers.

 

I've tried with:



RewriteRule ^(.+)/(\d+)$ /search.php?text=$3&&page=$2 [L]


 

But isn't working and I'm pretty sure it will not accept just what I want..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.