Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

laravel 4 - PUT request 403 Forbidden

Developing an API using laravel.

Getting 403 Forbidden on PUT request.

Works on a remote server but not locally. Using MAMP for the local server.

Here is my virtual host, I don't see anything off.

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "/Users/dg/Documents/Websites/domain.com/public_html/dev/public_html" ServerName domain.local ServerAlias www.domain.local <Directory /> Options Indexes FollowSymLinks AllowOverride All </Directory> ErrorLog "/Users/dg/Documents/Websites/domain.com/public_html/dev/error_log" CustomLog "/Users/dg/Documents/Websites/domain.com/public_html/dev/access_log" common </VirtualHost>

I've looked at other similar questions on SO but no solution yet.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Found the solution here: https://serverfault.com/questions/275512/put-request-results-in-403-forbidden-need-apache-to-allow-put-requests

Added the following to .htaccess at the document root:

<Limit GET POST PUT DELETE HEAD OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST PUT DELETE HEAD OPTIONS> Order deny,allow Deny from all </LimitExcept>


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...