Search code examples
.htaccessmod-rewriteurl-rewritingtypo3-9.xhttp-status-code-500

HTTP 500 Error Ionos with TYPO3 because of Rewrite Non-www to www in .htaccess


I got the following code in my .htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  RewriteCond %{HTTP_HOST} ^example.de [NC]
  RewriteRule ^(.*)$ https://www.example.de/$1 [L,R=301,NC]
</IfModule>

If I call the url without "www" everything works fine! But with "www" it ends with http 500 error! So on my development Server erverything works fine, with and without www! On Ionos Server I can do what I want I guess. I got https://www.expample.de in my Siteconfiguration of TYPO3 9.5 but it doesnt matter. Does anybody know a solution?

I think this is maybe not a .htaccess problem?!


Solution

  • Fix for IONOS hosted TYPO3 installations where adding www to the URL gives a 500 error:

    1. Go to your install tool, /typo3/install.php should be accessible with www in the URL.
    2. Go to Settings and open Configure Installation-Wide Options
    3. Under [SYS][trustedHostsPattern] where SERVER_NAME is set by default, add your domain, for example. .*\.domain\.com (There are other examples given in the install tool).
    4. Save these changes, the website is now accessible with www.