How to … use ssl and ssl-proxy on Host Europe via .htaccess with TYPO3

How to

Two questions and my solution (works with TYPO3 4.5 on HostEurope Webpack 3.0)

1. Use ssl or ssl-proxy at your website (in my case TYPO3)

2. Use only the www. variant from your website (duplicate content).

Caution: Code is especially for HostEurope, change IP and Proxyaddress !

 

force ssl (.htaccess)

#redirect for non-ssl
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} !^www\.domain\.de$ [NC]
RewriteRule ^(.*)$ http://www.domain.de/$1 [R=301,L]

#redirect for ssl
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} !^www\.domain\.de$ [NC]
RewriteRule ^(.*)$ https://www.domain.de/$1 [R=301,L]

 

force ssl-proxy (.htaccess)

#1st option, ssl.proxy ip with wildcard
RewriteCond %{REMOTE_ADDR} !10.9.0.*$
#2nd option, use ssl-proxy address
#RewriteCond %{HTTP:X-Forwarded-Server}  !^ssl.webpack\.de$ 

#redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\.domain\.de$
RewriteRule (.*) http://www.domain.de/$1 [L,R=301]

 

You will also need some Extensions and php-Code

So, that’s all – enjoy (or post your solution!)

 

Related posts:

  1. TYPO3 4.5 – sendmail on Host Europe Server
  2. How to – redirect restricted TYPO3 pages to loginform and back
  3. How to autoupdate WordPress hosted at Host Europe
  4. Problems after upgrading TYPO3 4.2 to 4.3 with stylesheets and images

2 Responses to “How to … use ssl and ssl-proxy on Host Europe via .htaccess with TYPO3”


  1. 1 blumentritt
  2. 2 Michael Cannon

    I just got to say a big thank you for the SERVER_PORT reference. It’s been bothering me that my redirect for https://example.com went to http://www.example.com. Now I know why and have fixed the .htaccess.

    # Domain redirects example.com to http://www.example.com
    # redirect for non-ssl
    RewriteCond %{SERVER_PORT} ^80$
    RewriteCond %{HTTP_HOST} ^2elearning\.com$ [NC]
    RewriteRule ^(.*)$ http://www.2elearning.com/$1 [R=301,L]

    # redirect for ssl
    RewriteCond %{SERVER_PORT} ^443$
    RewriteCond %{HTTP_HOST} ^2elearning\.com$ [NC]
    RewriteRule ^(.*)$ https://www.2elearning.com/$1 [R=301,L]

    Please keep these snippets coming.

Leave a Reply

*