Url mod_rewrite for static chained pages

Posted by user1121487 on Stack Overflow See other posts from Stack Overflow or by user1121487
Published on 2012-11-04T14:24:24Z Indexed on 2012/11/04 17:01 UTC
Read the original article Hit count: 161

Filed under:
|
|

How can I achieve this with mod_rewrite?

from:
.com/index.php?menu=home
to:
.com/home

AND

from:
.com/index.php?menu=home&list=hello
to:
.com/home/hello

ALSO (without the folder hierarki)

from:
.com/index.php?menu=home&list=hello
to:
.com/hello

I'm using this for the first one:

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

But how to I connect them if there are multiple variables?

Tried this:

RewriteRule ^([^/]*)/([^/]*)?$ index.php?home=$1&list=$2

© Stack Overflow or respective owner

Related posts about php

Related posts about url