简体   繁体   English

TYPO3 9.5.20 .htaccess 重定向 - 重定向过多

[英]TYPO3 9.5.20 .htaccess redirect - too many redirects

I am trying to redirect all pages to /uk apart from the home page and the /uk page but I get localhost redirected you too many times when it loads the /uk page.我正在尝试将除主页和/uk页面之外的所有页面重定向到/uk ,但是当它加载/uk页面时,我让localhost redirected you too many times I thought !^/uk$ would solve this.我认为!^/uk$会解决这个问题。 Any help is greatly appreciated任何帮助是极大的赞赏

Here is my code in the .htaccess file;这是我在.htaccess文件中的代码;

# Add your own rules here.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/$ [NC]
    RewriteCond %{REQUEST_URI} !^/uk$ [NC]
    RewriteCond %{HTTP_COOKIE} !cookieConfirmed=1;? [NC]
    RewriteRule . /uk [L,R=301]
</IfModule>

These should work:这些应该有效:

RewriteCond %{REQUEST_URI} !^/$ [NC]
RewriteCond %{REQUEST_URI} !^/uk/?$ [NC]
RewriteRule ^(.*) /uk [L,R=301]

Maybe you added a slash to all URLs so the too many redirects occurs?也许您为所有 URL 添加了一个斜杠,以便发生过多的重定向? So I made a / at the end optional.所以我在最后做了一个 / 可选。

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

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