Page 1 of 1

Using RegEx to rewrite/"pretty" URLs

Posted: Wed Oct 22, 2008 2:49 pm
by calrockx
I'm trying to make some "pretty" URLs on a website, but ehh....what I've got isn't working.



The site URL could be anything from

http://vitanova.charlesrubinoff.com/ind ... esidential

to

http://vitanova.charlesrubinoff.com/ind ... age=01.jpg



So there are up to three queries... section, category, and image.



Only when the user is in a Section part of the site (as in vitanova.com.com/?section=residential and not vitanova.com/?page=contact), I'd like the URL to be formatted like this:

vitanova.com/galleries/residential/bathrooms/01



So I'm making it look like they're in a galleries subfolder that doesn't really exist.

Here's what I've got, and it's not working...

Rewrite Rule ^galleries/([^/]+)/([^/]+)?/?([0-9][0-9]+)?$ /index.php?section=$1&category=$2&image=$3 [L]



Any ideas?