简体   繁体   English

Magento网站副本重定向到旧域,尽管我可能找到所有因素

[英]Magento site copy redirecting to old domain despite all factors I could possibly find

Just a day ago my staging copy of our production website was working perfectly. 就在前一天,我的生产网站的临时副本完美运行。 I see no connection with anything that happened since then that could cause this. 我认为从那以后发生的任何事都没有任何联系可能导致这种情况。

  • Live site: http://www.domain.co.uk/ 直播网站: http://www.domain.co.uk/http://www.domain.co.uk/
  • Stage site: http://devdomain.com/stage/site/ 舞台网站: http://devdomain.com/stage/site/http://devdomain.com/stage/site/

Both of these domains are on the same server, each a separate Magento installation with only one store. 这两个域都位于同一台服务器上,每个域都是一个单独的Magento安装,只有一个商店。 Database was dumped from live using mage-dbdump.sh of Sonassi. 使用Sonassi的mage-dbdump.sh从实时转储数据库。

At first I noticed the site completely redirects to our live site no matter what URL. 起初我注意到无论使用什么URL,该网站都会完全重定向到我们的实时网站。 After fixing a few things I noticed I can then run any PHP file other than the index.php of Magento, which always does a 302 redirect to live site according to Firebug Net tab. 在修完了一些事情之后,我注意到我可以运行除Magento的index.php以外的任何PHP文件,根据Firebug Net选项卡,它总是进行302重定向到实时站点。 (First header is for stage/site 302 Found, second one is live site 200 OK) (第一个标题是用于舞台/网站302发现,第二个是现场网站200 OK)

Several more fixing attempts later and it redirects to live site no matter what without even saying in the Firebug Net tab that it redirected. 稍后再进行几次修复尝试,无论什么甚至没有在Firebug Net选项卡中重定向,它都会重定向到实时网站。

Here is the list of things I have done trying to fix it (might have forgotten some by now): 以下是我尝试修复它的事情列表(可能现在已经忘记了一些):

  1. Changed secure and unsecure base URLs in DB as shown at the top of this post (http and https) 更改了DB中的安全和不安全的基本URL,如本文顶部所示(http和https)
  2. Changed resource URLs like CSS/JS and media in DB to use the base URL variables in curly braces 更改了CSS中的CSS / JS和媒体等资源URL,以使用大括号中的基本URL变量
  3. Changed base URLs in app/etc/local.xml 在app / etc / local.xml中更改了基本URL
  4. Ensured DB user, password and host address is correct 确保数据库用户,密码和主机地址正确无误
  5. Replaced all occurrences of live address to stage address in .htaccess 将所有出现的实时地址替换为.htaccess中的阶段地址
  6. In .htaccess tried commenting Rewrite Base, and uncommenting with "/" and "/stage/site/" 在.htaccess尝试评论Rewrite Base,并取消注释“/”和“/ stage / site /”
  7. Ensured .htaccess uses index.php as "DirectoryIndex" 确保.htaccess使用index.php作为“DirectoryIndex”
  8. Disabled CSS and JS merging in DB 在DB中禁用CSS和JS合并
  9. Used chown on the entire devdomain to ensure everything works as it should 在整个devdomain上使用chown来确保一切正常工作
  10. Used chmod 755 on all directories and chmod 644 on all files and chmod 550 on the "mage" file 在所有目录上使用chmod 755 ,在所有文件上使用chmod 644 ,在“mage”文件上使用chmod 550
  11. Used magento-cleanup.php 使用magento-cleanup.php
  12. Used magento-check.php (at first it was same as live, later after trying many things chmod() got forbidden to it for some reason) 使用了magento-check.php(起初它和live一样,之后尝试了很多东西chmod()因为某些原因被禁止了)
  13. Used another short PHP script to get Mage::app and clear cache 使用另一个简短的PHP脚本来获取Mage :: app并清除缓存
  14. Removed /tmp/magento and /tmp/livedomain on server 删除了服务器上的/ tmp / magento和/ tmp / livedomain
  15. Restarted Apache on server 在服务器上重新启动Apache
  16. Tried all the mentioned things on Chrome, Firefox, Vivaldi, Firefox Developer Edition and all their private browsing windows and clearing browser cache and cookies 在Chrome,Firefox,Vivaldi,Firefox Developer Edition及其所有私人浏览窗口中检查所有上述内容并清除浏览器缓存和Cookie
  17. Enabled error display on index.php, but obviously I couldn't get anywhere near that since it kept redirecting 在index.php上启用了错误显示,但显然我无法靠近它,因为它保持重定向
  18. Removing local.xml to try and trigger Magento install 删除local.xml以尝试触发Magento安装
  19. Removing .htaccess allowed any other PHP files to run, except index.php still redirects all the same 删除.htaccess允许运行任何其他PHP文件,但index.php仍会重定向所有相同的文件
  20. Removing any parent directory .htaccess files (which only had Options -Indexes anyway) 删除任何父目录.htaccess文件(无论如何只有选项 - 索引)
  21. Installing a fresh Magento website and configuring in the same way as the stage site, but in http://devdomain.com/stage/magento/ and using the same .htaccess as the stage site (replacing all occurrences of "/stage/site/" with "/stage/magento/"). 安装新的Magento网站并以与舞台网站相同的方式进行配置,但在http://devdomain.com/stage/magento/使用与舞台网站相同的.htaccess(替换所有出现的“/ stage / site”) /“with”/ stage / magento /“)。 This worked fine. 这很好。
  22. Reindexing through PHP on console 在控制台上通过PHP重新编制索引

Please tell me what I could have possibly missed. 请告诉我可能错过的内容。

Chrome caches redirects: Chrome缓存重定向:

https://superuser.com/questions/304589/how-can-i-make-chrome-stop-caching-redirects https://superuser.com/questions/304589/how-can-i-make-chrome-stop-caching-redirects

(even though you said you cleared the cache.) (即使你说你清除了缓存。)

You can also change the base URL on fresh installation to point to the old staging URL, after moving your old staging app to another directory, and verify if the redirection still happens. 在将旧的临时应用程序移动到另一个目录之后,您还可以在全新安装时更改基本URL以指向旧的临时URL,并验证重定向是否仍然发生。

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

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