php request vars in sef urls -
php request vars in sef urls -
i have page (ie www.mysite.com/products.php?catid=5
) in utilize $_request[catid']
category id , utilize in query. switched sef urls , urls display www.mysite.com/products/category/5
how can utilize new urls retrieve catid
value?
the next lines used in .htaccess file switching sef urls:
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !^/index.php rewritecond %{request_uri} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [nc] rewriterule (.*) index.php rewriterule .* - [e=http_authorization:%{http:authorization},l]
you need rewrite url correspondingly using mod_rewrite example.
rewriterule ^(.*)$ index.php?url=$1 [nc,qsa]
this rule rewrite url www.mysite.com/products/category/5
www.mysite.com/index.php?url=products/category/5
. point on can parse variable $_get["url"]
or refine rewrite rule.
php sef
Comments
Post a Comment