我有一个从localhost运行的项目,我正在使用wamp本地服务器来运行我的项目。像localhost/re-re是我的项目文件夹一样,如何使用.htaccess在url重写中写入,
我试过了,但它抛出了一个错误
这是我的.htaccess
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^localhost/re/?$ refer.php [NC,L] # Handle requests for "re"
当我以localhost/re 的身份运行时
错误为
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
那么我该怎么做呢。提前感谢
Amit
您可以使用DirectoryIndex
来完成此操作
RewriteEngine On
RewriteBase /re/
DirectoryIndex refer.php
现在您的默认文件是refer.php