Apache为我的域创build的子域提供500内部服务器错误

我已经创build了一个名为http://admin.stenzsolutions.com的子域名,只是为了testing子域名,我主持了与主域名http://www.stenzsolutions.com相同的内容

现在我遇到了子域的问题…主页加载正常,但如果点击任何链接,它会给我一个500内部服务器错误…主要作品像梦一样的内容,没有问题…这是我遇到的问题的确切描述…


Internal Server Error --------------------- The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache Server at admin.stenzsolutions.com Port 80 

我只是GOOGLE了,发现我的.htaccess文件可能有问题…所以这里是我的.htaccess文件


 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 

这里是我从服务器错误日志得到的确切的错误


 Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 

这听起来像你有你的代码中的绝对链接。 而不是重写,这不应该是必要的这种情况下,你是最好的,让你的链接相对。 正如你现在发现的那样,将绝对值用于内部链接确实是一个不好的做法,因为它打破了可移植性,只是造成了维护的噩梦。

编辑:

最好检查生成的HTML中的问题,而不是源代码。 使用Firefox或Chrome浏览器(以及除IE以外的浏览器)可以通过下面的“小书签”轻松完成(为任何页面创build书签并用此代码replaceURL)。

 javascript:%20var%20win%20=%20window.open();%20win.document.write('<html><head><title>Generated%20HTML%20of%20%20'%20+%20location.href%20+%20'</title></head><pre>'%20+%20document.documentElement.innerHTML.replace(/&/g,%20'&amp;').replace(/</g,%20'&lt;')%20+%20'</pre></html>');%20win.document.close();%20void%200; 

.+也匹配index.php 。 这是无限循环的原因。 一些方法来解决这个问题:

  1.  RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_URI} !^/index\.php RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 
  2.  RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L]