【发布时间】:2015-06-18 20:08:59
【问题描述】:
我试图在我的 apache 2.2 上允许“put”方法,但是我尝试过什么(Limit、LimitExcept ...),
我总是收到以下错误:
405 Method Not Allowed
The requested method PUT is not allowed for the URL
这是我的 http.conf :
<VirtualHost *:80>
ServerName example.com:80
DocumentRoot "D:/test"
Include "D:/conf/httpd.conf"
<Directory />
Order Allow,Deny
Allow From All
Options Indexes FollowSymLinks MultiViews
<LimitExcept GET PUT POST DELETE>
Order allow,deny
Allow from all
</LimitExcept>
</Directory>
</VirtualHost>
更新: 我阅读了一些相关的帖子,如下所示:
http://stackoverflow.com/questions/2934554/how-to-enable-and-use-http-put-and-delete-with-apache2-and-php
但我没有任何脚本 php 或 cgi。
我只想用 mod_rewrite 将 http 调用(get、post、put delete ...)重定向到模拟文件:
RewriteCond %{REQUEST_URI} ^/maincall/customer
RewriteCond %{REQUEST_METHOD} PUT
RewriteRule /maincall/customer %{DOCUMENT_ROOT}/mockfolders/PUT/data.json
【问题讨论】:
标签: apache mod-rewrite put http-status-code-405