请有人帮我编辑我的htaccess。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^supplyer/([0-9]+)/([0-9a-zA-Z_-]+) supplyer.php?page=$1&id=$2 [NC,L]
</IfModule>
我想要的: 1.每个文件.php删除.php 重写URL 2. supplyer.php?page = edit&amp; id = 120 to supplyer / edit / 120
对于第一个它正常工作但第二个它不起作用有人帮助我。
答案 0 :(得分:0)
要匹配/supplyer/edit/120
uri字符串,您的模式应为^supplyer/([0-9a-zA-Z_-]+)/([0-9]+)
尝试:
RewriteRule ^supplyer/([0-9a-zA-Z_-]+)/([0-9]+)/?$ supplyer.php?page=$1&id=$2 [NC,L]