我有文件/tm/index.php,我想用这样的规则重写:
RewriteRule ^tm/([a-zA-Z1-9]*)$ /tm/index.php?p=$1 [L]
当我尝试将PUT请求发送到重写的URL时,我收到HTTP错误:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL /tm/295014.</p>
</body></html>
我无法知道该怎么做。当我调用/tm/index.php?p=295014它工作正常,但我不能以这种方式使用它。请帮助改变重写规则。
答案 0 :(得分:0)
问题与重写规则无关,您的index.php
未设置为接受PUT
方法。这就是405错误告诉你的。
请看一下这个答案,以便允许PUT请求:https://stackoverflow.com/a/2935714/851273