我正在尝试编写一个简单的 mod_rewrite 规则,但我不知道它为什么不起作用。
我只是想重写http://example.com/to/abc为http://example.com/to/index.py?to=abc.
目前,我的重写规则是:
RewriteEngine On
RewriteRule ^/?to/(.*)$ /to/index.py?to=$1
据我所知,它应该与任何类似的 URL 匹配/to/whatever,带或不带前导/.
谁能告诉我我在这里缺少什么?