我有一些卡住。我是config。Apache
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot /home/abc/Projects/
ServerAlias *.example.com
ServerName example.com
ErrorLog error.log
</VirtualHost>
我的>。htaccess
文件RewriteCond %{HTTP_HOST} ^(.+)'.example'.com$ [NC]
RewriteRule ^(.*)$ /%1/$1 [QSA,L]
我的网页返回内部服务器错误
如何配置。接受
查询
- : http://test.example.com
这意味着- : http://example.com/test/
- test是根目录下的一个文件夹。
update My Error Log
[Sat Aug 22 21:29:58.093791 2015] [core:error] [pid 31081] [client 192.168.83.1:7322] AH00124:由于可能的配置错误,请求超过10个内部重定向的限制。如果需要,使用'LimitInternalRecursion'来增加限制。使用'LogLevel debug'来获取回溯。,参考:http://test.example.com/
Apache/2.4.10 (Ubuntu) Server at test.example.com端口80
你的规则是无限循环的,最终导致500个错误。要阻止它,您可以使用这个附加条件:
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(.+)'.example'.com$ [NC]
RewriteRule ^(.*)$ %1/$1 [L]
%{ENV:REDIRECT_STATUS}
是mod_rewrite
内部变量,在第一次内部重写后被设置为200。