简体   繁体   English

Drupal站点不断重定向

[英]Drupal site keeps on redirecting

Base URL is already set to in the settings.php file 基本URL已在settings.php文件中设置为

$base_url = 'https://<site_name>.com.au";

But when accesssing it thru www.<site_name>.com.au it seems that it will have a redirect loop. 但是,当通过www.<site_name>.com.au它时,它似乎将具有重定向循环。

Here's the .htaccess Rewrite: 这是.htaccess重写:

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} www\. [NC]
RewriteRule ^ http%{ENV:protossl}://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

When enforcing or stripping www, to avoid a bounce between HTTP and HTTPS, you should also uncomment the following in the .htaccess file: 强制或剥离www时,为避免HTTP和HTTPS之间出现反弹,还应在.htaccess文件中取消注释以下内容:

  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

The comments in the default .htaccess file define the above lines in function as such: 默认.htaccess文件中的注释按以下方式定义函数中的上述行:

Set "protossl" to "s" if we were accessed via https://. 如果通过https://访问我们,请将“ protossl”设置为“ s”。 This is used later if you enable "www." 如果启用“ www”,则稍后使用。 stripping or enforcement, in order to ensure that you don't bounce between http and https. 剥离或强制执行,以确保您不会在http和https之间跳出。

If you're adding the lines manually, make sure they precede your re-write, but come after 如果要手动添加这些行,请确保它们在您的重写之前,但在重写之后

<IfModule mod_rewrite.c> RewriteEngine on

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

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