Url 自动写下划线

Url rewrite with underline automaticly

我正在尝试从

自动重写 url
www.example.com/test.php?title=123jane

www.example.com/test_123jane

我正在使用

RewriteRule    ^test_([A-Za-z0-9-]+)/?$    test.php?title=    [NC,L]'

但这不会自动更改它。

RewriteEngine On

RewriteCond %{THE_REQUEST} ^GET\ /test\.php\?title=([a-z0-9]+) [NC]
RewriteRule ^test\.php$ /test_%1? [R=301,L,NC]

RewriteRule ^test_([a-z0-9]+)$ /test.php?title= [L]

以上应该有效。