带有SSL的Typo3多域:TOO_MANY_REDIRECT



使用typo3 4.5/extbase 1.3我试图在多域环境中运行我的商店扩展:商店页面应在http域A上运行,并在HTTPS域上进行以下结帐过程B.域B是https://www.ssl-id.de/[domaina](主机是strato)。因此,我已经设置了:

  1. 两个根部树都有两个根,分别具有域A和域B的域输入
  2. HTTPS页面中的结帐页面已将"使用协议"设置为https
  3. ts:baseUrl的设置为域A或域B(基于env:http_host)
  4. 为两个域设置了RealUrl配置(带有$ typo3_conf_vars ['extConf'] ['realurl'] ['[domaina]']和$ typo3_conf_vars ['extconf']-id.de']))

不幸的是,从HTTP商店重定向到HTTPS结帐会导致Chrome中的错误310(NET :: ERR_TOO_MANY_REDIRECTS)。网络报告说

Request URL:https://www.ssl-id.de/[domainA]/de/checkout.html?FE_SESSION_KEY=bc04cd0f5b835bcbdd8c475bafb037f7-ab3700f6a9fae520b75981130b31ec77&cHash=6d7e7195735947b09becbfa9c26c8bf0
Request Method:GET
Status Code:301 Moved Permanently
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Cookie:fe_typo_user=bc04cd0f5b835bcbdd8c475bafb037f7
Host:www.ssl-id.de
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4
Query String Parametersview URL encoded
FE_SESSION_KEY:bc04cd0f5b835bcbdd8c475bafb037f7-ab3700f6a9fae520b75981130b31ec77
cHash:6d7e7195735947b09becbfa9c26c8bf0
Response Headersview source
Connection:Keep-Alive
Content-Length:0
Content-Type:text/html; charset=utf-8
Date:Wed, 07 Nov 2012 09:54:06 GMT
Keep-Alive:timeout=3, max=99
Location:https://www.ssl-id.de/[domainA]/de/checkout.html?FE_SESSION_KEY=bc04cd0f5b835bcbdd8c475bafb037f7-ab3700f6a9fae520b75981130b31ec77&cHash=6d7e7195735947b09becbfa9c26c8bf0
Server:Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r
Set-Cookie:fe_typo_user=bc04cd0f5b835bcbdd8c475bafb037f7; path=/[domainA]/
X-Powered-By:PHP/5.3.8

读为"目标页URL不存在,请再次查看相同的URL"。当使用第二个HTTP URL而不是HTTPS URL时,设置效果很好。直接调用Checkout页面而无需从商店页面重定向时,结果是相同的错误310。

.htaccess是一个相当标准的typo3-realurl .htaccess:

AddDefaultCharset utf-8
AddType video/mp4 mp4
AddType video/mp4 m4v
AddType video/ogg ogv
AddType video/webm webm
AddType video/webm webmv
<FilesMatch ".(js|css)$">
  <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault "access plus 7 days"
  </IfModule>
  FileETag MTime Size
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).(d+).(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon.ico) - [L]
RewriteRule ^typo3$ typo3/index_re.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]
</IfModule>

有关如何消除重定向问题或如何靠近重定向的呼叫者的任何建议

问题是主机(strato)特定的:他们的SSL代理不会发送相关的$ _server ['https'],以某种方式使Typo3变得疯狂。

解决方案是通过在localconf.php的末尾添加以下行来设置$ _server ['https']

if ($_SERVER['HTTP_X_FORWARDED_HOST'] == "www.ssl-id.de") {  
    $_SERVER['HTTPS'] = 1;  
}

或更多一般

if (this_is_a_ssl_request()) {  
    $_SERVER['HTTPS'] = 1;  
}

相关内容

  • 没有找到相关文章

最新更新