简体   繁体   English

HTTP TYPO3 500 错误 Ionos 因为在 .htaccess 中将非 www 重写为 www

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

I got the following code in my .htaccess我在我的 .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.如果我在没有“www”的情况下调用 url,一切正常,但如果使用“www”,它会以 http 500 错误结尾。 So on my development Server erverything works fine, with and without www!所以在我的开发服务器上一切正常,有和没有 www! On Ionos Server I can do what I want I guess.在 Ionos 服务器上,我可以做我想做的事。 I got https://www.expample.de in my Siteconfiguration of TYPO3 9.5 but it doesnt matter.我在 TYPO3 9.5 的站点配置中得到了https://www.expample.de但这并不重要。 Does anybody know a solution?有人知道解决方案吗?

I think this is maybe not a .htaccess problem?!我认为这可能不是 .htaccess 的问题?!

Fix for IONOS hosted TYPO3 installations where adding www to the URL gives a 500 error:修复 IONOS 托管的 TYPO3 安装,其中将 www 添加到 URL 会出现 500 错误:

  1. Go to your install tool, /typo3/install.php should be accessible with www in the URL. Go 到您的安装工具,/typo3/install.php 应该可以通过/typo3/install.php中的 www 访问。
  2. Go to Settings and open Configure Installation-Wide Options Go 到Settings并打开Configure Installation-Wide Options
  3. Under [SYS][trustedHostsPattern] where SERVER_NAME is set by default, add your domain, for example.例如,在默认设置SERVER_NAME[SYS][trustedHostsPattern]下,添加您的域。 .*\.domain\.com (There are other examples given in the install tool). .*\.domain\.com (安装工具中给出了其他示例)。
  4. Save these changes, the website is now accessible with www.保存这些更改,该网站现在可以通过 www 访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM