简体   繁体   中英

Wordpress database configuration causing redirect loop

Everytime I deploy a major update and changes the database I have this problem. In this current project it's the third time it happens.

When I go to WWW.mydomains.com.br the website opens perfectly. If I go to mydomains.com.br I get a redirect loop problem. My website address and Wordpress address are both set to http://www.mydomains.com.br . If I remove the WWW i get the redirect loop when I access WWW.mydomains.com.br .

I add the WP_HOME and the WP_SITEURL constants to wp-config.php I still get this problem.

If I add or remove WWW with HTACCESS it seems to be ignored (well it doesnt seem to change anything).

RewriteCond %{HTTP_HOST} ^mydomains.com.br$
RewriteRule (.*) http://www.mydomains.com.br/$1 [R=301,L]
#or
RewriteCond %{HTTP_HOST} ^www.mydomains.com.br$
RewriteRule (.*) http://mydomains.com.br:80/$1 [R=301,L]

If I click on Permalinks page and redefine it, it is not helping.

BUT I am very sure that one or more of these solutions have already helped in the past, in one of my previous attempts to solve it.

It is always redirecting to itself, even if I remove the redirect rules of the .htaccess (or empty it).

I am using Openshift to host my files and Cloudflare as DNS server. This is the second project I work on and I have the same problem. I never understand how I fix it, so every new problem is a new challenge.

I believe it's the database because when I find a solution it gets ruined when I migrate the database again (after changing localhost to mydomains.com.br )

What am I missing? Is it a server cache?

may be you need to check your "index.php", make sure there are no redirects inside it. This problem once happened to me because i had more than one redirect in my php. When it's the case, the browser gets confused on which 1 to choose hence crashes down...

在index.php中检查索引调用的所有include()文件,这可能是其中的1个重定向成功的原因……也许您需要以图形方式说明问题4更好的理解

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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