search

Home  >  Q&A  >  body text

php - Why do pseudo-static rules have no effect?

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?

大家讲道理大家讲道理2749 days ago885

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-05-18 10:48:50

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

    reply
    0
  • 高洛峰

    高洛峰2017-05-18 10:48:50

    <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]

    reply
    0
  • Cancelreply