dongpouda6700 2011-01-12 17:57 采纳率: 100%
浏览 52
已采纳

500.0表单发布时重写服务器错误

Windows 2008 R2 server running PHP 5.3.

I have URL Rewrite for IIS working for our website.

The rewrite is:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{R:1}" pattern="^(images|documents|system|themes|favicon\.ico|robots\.txt|index\.php)" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/index.php/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

All of the pages (domain.com/contact) work just fine. But when posting a form, I get a 500.0 server error...which MSFT says has to do with rewrite or module errors.

I installed Fiddler and the Raw Request headers in TextView look like so

POST http://stage.domain.edu/ HTTP/1.1
Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap
Referer: http://stage.domain.edu/contact
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: stage.domain.edu
Content-Length: 519
Connection: Keep-Alive
Pragma: no-cache
Cookie: exp_last_visit=978203019; exp_last_activity=1293563019; exp_tracker=a%3A5%3A%7Bi%3A0%3Bs%3A7%3A%22contact%22%3Bi%3A1%3Bs%3A5%3A%22index%22%3Bi%3A2%3Bs%3A7%3A%22contact%22%3Bi%3A3%3Bs%3A5%3A%22index%22%3Bi%3A4%3Bs%3A7%3A%22contact%22%3B%7D; exp_last_visit=1293563019; exp_last_activity=1294854559

ACT=27&RET=&URI=contact&recipients=HJAUumiTKThex9cAcYNq%2FyBQNLeXkIqACdl3EgaimNM%3D&user_recipients=7f73421623ceb94b5d06abe41d8663dd&charset=&redirect=&replyto=&site_id=2&subject=Contact+Form&to=sxxxxxx@xxxxx.edu&required%5B%5D=Full+Name%3A&required%5B%5D=stephanie&required%5B%5D=Phone%3A&required%5B%5D=954520-1176&sender=E-mail%3A&from=sxxxxxxx@gmail.com&required%5B%5D=Zip+Code%3A&required%5B%5D=33073&message=This+information+was+submitted+via+the+contact+form.&submit.x=72&submit.y=14

What in here could be causing posting variables to the index.php main file to 500?

  • 写回答

1条回答 默认 最新

  • dtfbj24048 2011-02-09 16:06
    关注

    Just for the sake of completion, the issue was with the server giving 500 errors if anything was wrong, and in the CMS there were 2 issues:

    1) I had to set up the SMTP config correctly

    Then I just got a blank page.

    2) What was happening was that the CMS uses /n in emails as newline, and on Windows boxes, the equivalent of a newline is /r/n....so upon changing that in the HTML email config, all worked fine!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误