多个程序都有这种现象,可排除程序问题。。,或许是服务端配置的问题?
curl 结果,似乎只有静态文件(js/css)才会 500 :
C:\Users\lslqtz>curl -I
http://abc.com/content/themes/default/bootstrap/js/bootstrap.min.js HTTP/1.1 500 Internal Server Error
Content-Length: 27822
Content-Type: application/x-javascript
Last-Modified: Sat, 14 May 2016 15:49:00 GMT
Accept-Ranges: bytes
ETag: "03ebd21f8add11:0"
Server: Microsoft-IIS/7.5
X-Powered-By:
ASP.NET Date: Sat, 21 Jan 2017 14:36:23 GMT
C:\Users\lslqtz>curl -I
http://abc.com/content/themes/default/bootstrap/js/bootstrap.min.js HTTP/1.1 200 OK
Content-Length: 27822
Content-Type: application/x-javascript
Last-Modified: Sat, 14 May 2016 15:49:00 GMT
Accept-Ranges: bytes
ETag: "03ebd21f8add11:0"
Server: Microsoft-IIS/7.5
X-Powered-By:
ASP.NET Date: Sat, 21 Jan 2017 14:36:25 GMT
C:\Users\lslqtz>
附上 IIS 规则:
<rule name="1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^abc.com$" />
<add input="{URL}" pattern="^/abc/" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="abc/{R:1}" appendQueryString="true" />
</rule>
是在 IIS 下直接用.htaccess 转过来的,原规则:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com$ [NC]
RewriteCond %{REQUEST_URI} !^/abc/
RewriteRule ^(.*)$ abc/$1 [L,QSA]