使用.htaccess从php url中删除id

时间:2016-05-29 19:45:23

标签: php url url-rewriting

我试图从网址中删除ID以使其更加友好:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1\.php

RewriteBase /
RewriteRule ^cat/([a-zA-Z0-9---_]+)$ browse.php?id=$1
RewriteRule ^products/([a-zA-Z0-9---_]+)$ item.php?id=$1
RewriteRule ^products/([a-zA-Z0-9---_]+)&history=view$ item.php?id=$1&history=view

0 个答案:

没有答案