Forum Moderators: phranque

Message Too Old, No Replies

Rewriting Multiple Gets

         

Tom_Cash

3:58 pm on Nov 19, 2010 (gmt 0)

10+ Year Member



Hey Peeps,
I have been using this code for a while now and forgot how it worked. So now I've come to work with an additional get statement I can't figure it out.

I did a quick bit of searching but couldn't put 2 and 2 together. I was wondering if someone could help me, please...

I want to push website.com/search/index.php?c=widgets
to
website.com/search/widgets

Which I did, no problem.

However, now I've developed pagination I want to add an additonal GET to this URL and want the link to look like this:

website.com/search/widgets/1

Rather than this, which it currently is:

website.com/search/widgets&p=1

Here's my mod_rewrite so far...

RewriteEngine on
RewriteRule ^([^/\.]+)/?$ index.php?c=$1 [L]


Could someone help me please? It would be greatly appreciated.

Tom.

Tom_Cash

3:54 pm on Nov 21, 2010 (gmt 0)

10+ Year Member



Bump...

jdMorgan

4:01 am on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




RewriteEngine on
#
RewriteRule ^([^/\.]+)/?$ index.php?c=$1 [L]
RewriteRule ^([^/]+)/([0-9]+)/?$ index.php?c=$1&p=$2 [L]

The resources cited in our Apache Forum Charter and the threads in our Apache Forum Library may prove useful to you.

Jim

Tom_Cash

8:41 am on Nov 30, 2010 (gmt 0)

10+ Year Member



Jim, thanks very much! :D I'll also get reading...