Welcome to WebmasterWorld Guest from 18.205.246.238

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Rewriting Multiple Gets

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

Junior Member

10+ Year Member

joined:June 26, 2008
posts:178
votes: 0


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.
3:54 pm on Nov 21, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:June 26, 2008
posts:178
votes: 0


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

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0



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
8:41 am on Nov 30, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:June 26, 2008
posts:178
votes: 0


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