1
votes

using typo3 4.5/extbase 1.3 i am trying to run my shop extension in a multidomain environment: the shop page should be run on a HTTP domain A and the following checkout process on a HTTPS domain B. Domain B is https://www.ssl-id.de/[domainA] (host is Strato). I therefore have set:

  1. two page trees with both roots having an domain entry of domain A and domain B respectively
  2. the checkout page in the HTTPS page tree have set "Use protocol" to HTTPS
  3. the TS:baseURL is set conditionally to domain A or domain B (based on the ENV:HTTP_HOST)
  4. the realurl configuration is set for both domains (with $TYPO3_CONF_VARS['EXTCONF']['realurl']['[domainA]'] and $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.ssl-id.de'])

Unfortunately the redirect from the HTTP shop to the HTTPS checkout leads to Error 310 (net::ERR_TOO_MANY_REDIRECTS) in chrome. The network report says

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

which reads as "The target page url does not exist, please look at the same url again". When using a second HTTP url instead of the HTTPS url, the setup works well. When calling the checkout page directly without redirect from the shop page, the result is the same error 310.

The .htaccess is a quite standard 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>

Any suggestions on how to remove the redirect problem or how to get closer to the caller of the redirect that leads to the infinite loop?

1

1 Answers

4
votes

The problem has been host (Strato) specific: Their SSL Proxy does not send the relevant $_SERVER['HTTPS'] which somehow makes typo3 go crazy.

The solution is setting $_SERVER['HTTPS'] yourself by adding the following lines to the end of your localconf.php:

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

or more general

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