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
- Install “https_enforcer” in TYPO3, Instructions: http://typo3.org/documentation/document-library/extension-manuals/https_enforcer/current/
- Follow the Instructions for ssl-proxy from here: http://wiki.typo3.org/De:Installation_at_Hosteurope
- more helpful links: ssl on TYPO3 #1, ssl on TYPO3 #2
So, that’s all – enjoy (or post your solution!)
Related posts:
one more link:
http://faq.hosteurope.de/index.php?cpid=10962
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.