Page 1 of 1

htaccess mod_rewrite help

Posted: Fri Mar 21, 2008 6:39 am
by turulojko
hi,
i need some help with .htaccess

i want urls like:
http://www.bla.com/gallery.php?what=dis ... 2007&pic=3

to be shown like:
http://www.bla.com/gallery/disco/kiss/12112007/3/

i use
RewriteRule ^gallery/(.*)/ gallery.php?what=$1
RewriteRule ^gallery/(.*)/(.*)/ gallery.php?what=$1&place=$2
...

but this only works when your url is http://www.bla.com/gallery/disco/
when your url is http://www.bla.com/gallery/disco/kiss/ (...) doesn't work.

so, can someone help me somehow?
thanks!

Re: htaccess mod_rewrite help

Posted: Fri Mar 21, 2008 7:14 am
by Rovas
Probably there is a problem in the php code. Take notice that you need you implement a function \ class that translates the new url string so PHP knows what' s going on.
Try this new rule:

Code: Select all

RewriteRule ^gallery/(([0-9] *)/([0-9] *) gallery.php?what=$1&place=$2