1

I have file /tm/index.php which I want to rewrite with such rule:

RewriteRule ^tm/([a-zA-Z1-9]*)$ /tm/index.php?p=$1 [L]

When I try to send PUT request to rewrited url I get HTTP error:

<!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>

I can't find out what to do. When I call /tm/index.php?p=295014 it works fine, but I can't use it in such way. Please help to change rewrite rule.

uzyn
  • 6,625
  • 5
  • 22
  • 41
Ruben Nagoga
  • 2,178
  • 1
  • 19
  • 30

1 Answers1

0

The problem has nothing to do with your rewrite rule, your index.php isn't setup to accept the PUT method. That's what the 405 error is telling you.

Take a look at this answer for allowing the PUT request: https://stackoverflow.com/a/2935714/851273

Community
  • 1
  • 1
Jon Lin
  • 142,182
  • 29
  • 220
  • 220