如何在PHP中重写url重写中的单独参数

时间:2017-05-06 13:04:13

标签: php mod-rewrite

我的wesite有两个url。

第一
localhost/job/2/Employment-News

第二
localhost/job/Latest-Admission/50571/UP-ITI-Admission-2016-Fourth-Round-Apply-Online-

我想获得单独的参数。

我在.htaccess中试过这个:

RewriteEngine On

RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+) category.php?Id=$1&category=$2
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+) post_details.php?postid=$1&post=$2&mycat=3 [L]

0 个答案:

没有答案