简体   繁体   English

.htaccess中的mod_rewrite规则跳过TYPO3中的URI

[英]mod_rewrite rule in .htaccess skips URI in TYPO3

I use this code for redirecting http to https 我使用此代码将http重定向到https

RewriteCond %{HTTPS} off 
RewriteCond %{HTTPS_HOST} !^www.tronsoeskolen.dk$ [NC]
RewriteRule ^(.*)$ https://www.tronsoeskolen.dk/$1 [L,R=301]

But it send every page with http to https://frontpage no matter it says after the domain. 但是,无论域名后面说什么,它都会将每个带有http的页面发送到https:// frontpage

Rewrite conditions are combined by AND , as long as you don't define anything else. 只要您不定义其他任何内容,重写条件就会由AND合并。 So there is no condition for handling your request without www. 因此,没有www,就没有条件可以处理您的请求。

Your rules do the following: 您的规则执行以下操作:

If it is not an https request AND the request comes not from host https://www.yourdomain.xy , then rewrite to https://www.yourdomain.xy . 如果不是https请求并且该请求不是来自主机https://www.yourdomain.xy ,则将其重写为https://www.yourdomain.xy

Combine your conditions by [OR] (example): 通过[OR]组合您的条件(例如):

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]

This combines the conditions to: if it is not an https request OR a request without www. 这将条件组合到:如果不是https请求没有www的请求。

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

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