我在.htaccess
:
RewriteRule ^potato/?$ /potato.php
所以当我输入:
example.com/potato/
我会得到:
example.com/potato.php
但是,出于特定原因,我需要更改以下网址:
example.com/potato/
到
example.com/
因为potato.php
要求网址中有一些流程是这样的。
我该如何解决这个问题?
答案 0 :(得分:1)
好吧,如果你坚持使用重写,你可以使用以下规则:
RewriteRule ^(/)?$ /potato.php
但是,我认为使用Apache的DirectoryIndex
指令会更好,所以将它添加到.htaccess中:
DirectoryIndex potato.php index.php index.html