php - pretty url with $_GET -


this question has answer here:

im trying pretty urls don't know htaccess.

trying like
this:

domain.com/?page=login
domain.com/?page=user&uid=2

to:

domain.com/login/
domain.com/user/2

do have specify this?:

domain.com/page?a=arg1&b=arg2&c=arg3
domain.com/page/arg1/arg2/arg3

or can "more dynamic"?

i using http://www.generateit.net/mod-rewrite/ . pretty easy figure out how it's done when used tool 2 or 3 times.

you can define parameters take "spot"

so your:

domain.com/?page=login domain.com/?page=user&uid=2 

to:

domain.com/login/ domain.com/user/2 

you can use:

rewriteengine on rewriterule ^([^/]*)/([^/]*)$ /?page=$1&uid=$2 [l] 

your "page" problem looks bit more difficult.

you have add rewrite rules each "page" or file guess.

at least don't know how that.

if it's folder solve giving folder own .htaccess

edit:

rewriteengine on rewriterule ^page/([^/]*)/([^/]*)/([^/]*)\.html$ /page.php?a=$1&b=$2&c=$3 [l] 

might work. added page/ under prefix in generator


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -