.htaccess - apache htaccess map first segment as parameter without disturbing other parameters -
this might classic .htaccess question, still couldn't find question specific case. here's closest found (parameters involve in case). done implementing 2 answers. couldn't work case.
my case
1) want access url,
mywebsite.com/any-first-segment?param1=a¶m2=b¶m3=c¶mn=anything
will remapped to
mywebsite.com/index.php?p=any-first-segment¶m1=a¶m2=b¶m3=c¶mn=anything
2) still working if there's no param.
3) never have more 1 segment. (zero segment still works, mapped index.php usual)
could suggest me working rewriterule case?
here's last .htaccess, still not working
options +followsymlinks rewriteengine on rewritecond %{request_filename} !-l rewriterule ^(.+)$ index.php?p=$1 [qsa,l]
[updated!] it's working. found messed options +followsymlinks
after reading this
here's working .htaccess. exception.
rewriteengine on rewritecond $1 !^(index\.php|images|robots\.txt|css) rewriterule ^(.+)$ index.php?p=$1 [qsa,l]
using qsa
flag in rule append current query string rewritten form.
Comments
Post a Comment