Xiu Xiu - 1 year ago 71
Apache Configuration Question

.htaccess rewrite pretty urls that can still use get variables

I'm trying to write an .htaccess line that will rewrite to a php script but still allow any extra get variables to be added on the end. Is this possible?

Currently I'm trying to use this:

RewriteRule ^item/([^/]*)([^/]*)$ /item.php?id=$1&$2 [L]

The aim is to be able to do things like
, but also

Currently it seems to correctly pass the first part,
, but not the rest.

str str
Answer Source
RewriteRule ^item/([^/]*)([^/]*)$ /item.php?id=$1&$2 [L,QSA]

You can read more about QSA (query string append) here: https://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download