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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.