regex - Problems with mod_rewrite and GET -


so, had question earlier mod_rewrite find here mod_rewrite changing /subpage/ /subpage

but have whole new problem this... how make work?

like if need pass variables get, ex: mypage.com/subpage/?name=jamie

my mod_rewrite looks this:

options +followsymlinks rewriteengine on rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f  rewriterule ^([a-za-z0-9-]+)/?$ ?p=$1 [l] 

i understand problem has pass , rewrite 1 request. how tweak accept other get-request might need process?

update:
clarify problem bit. if try url mypage.com/subpage/?name=jamie page loads if used url mypage.com/subpage/ , "name" never passed. using original url mypage.com?p=subpage&name=jamie works should.

i guess need tweak somehow... how?
thank taking time reading easy question!

use qsa flag — query string append:

rewriterule ^([a-za-z0-9-]+)/?$ ?p=$1 [l,qsa] 

'qsappend|qsa' (query string append)
flag forces rewrite engine append query string part of substitution string existing string, instead of replacing it. use when want add more data query string via rewrite rule.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -