1

我有文件 /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 它工作正常,但我不能以这种方式使用它。请帮助更改重写规则。

4

1 回答 1

0

该问题与您的重写规则无关,您index.php没有设置接受该PUT方法。这就是 405 错误告诉您的内容。

查看允许 PUT 请求的答案:https ://stackoverflow.com/a/2935714/851273

于 2012-07-27T17:54:26.123 回答