You are here:  » rewrite

Support Forum



rewrite

Submitted by babrees on Thu, 2009-02-05 06:58 in

I would guess this is relatively easy but I don't have a clue about rewriting!

I have a category list that is based on a specific search. I would like to rename the results page, so instead of /search.php?q=jumper I get something like /category/jumper

Submitted by support on Thu, 2009-02-05 11:12

Hi Jill,

You can pretty much copy the format of the other re-writes. As category is already in-use, let's say you want to map /catlist/jumper/ to search.php?q=jumper, use:

RewriteRule ^catlist/(.*)/$ search.php?q=$1&rewrite=1%{QUERY_STRING} [L]

Cheers,
David.

Submitted by babrees on Fri, 2009-02-06 16:16

Thanks David, This works brilliantly EXCEPT when there are multiple pages. Then it just throws a 404.

See it here: http://www.funkyduds.co.uk/funkyclothes/fashion/top/

Any way around this?

---------
Jill

Submitted by support on Sat, 2009-02-07 14:47

Hi Jill,

Ah yes, the following line will also be required to handle the follow on pages...

RewriteRule ^catlist/(.*)/(.*).html$ search.php?q=$1&page=$2&rewrite=1%{QUERY_STRING} [L]

Cheers,
David.