php - Why do pseudo-static rules have no effect?
大家讲道理
大家讲道理 2017-05-18 10:46:50
0
2
833

I want to convert the following dynamic rules into pseudo-static ones

原链接

/zt/tea.php?q=04年生茶

转为

/zt/04年生茶

My pseudo-static rules.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . / [L]
RewriteRule /zt/(\w+) /zt/tea.php?q=
</IfModule>

Why is this setting invalid?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
巴扎黑

RewriteRule ^/zt/(\w+)$ /zt/tea.php?q=$1

小葫芦
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . / [L]
RewriteRule /zt/tea.php=(\w+) /zt/tea.php?q=$1 [L]
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!