将 magento 站点移动到另一个主机,重定向到旧站点

编程入门 行业动态 更新时间:2024-10-23 09:32:26
本文介绍了将 magento 站点移动到另一个主机,重定向到旧站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们已将 magento 站点移至另一台主机.但它正在重定向到旧站点

We have moved out magento site to another host. But it is redirecting to the old site

我们在移动网站之前做了以下更改

We did following changes before moving the site

1. DB backup 2. files are zipped and copied to another host.

将网站移至其他主机后

1. changed the /web/secure and /web/unsecure values in the DB. 2. In magento files /app/etc/local.xml changed the database name. 3. cleared the var/cache 4. cleared the var/tmp 5. cleared the var/session.

但 magento 站点仍被重定向到旧站点.

but still the magento site is redirected to old site.

谁能帮我解决这个问题.

Can any one help me with this.

谢谢

推荐答案

克隆或移动网站所涉及的几个步骤.

注意:通常的做法是在复制到新位置之前清空 var/cache、var/session 目录.清除缓存在下面提到,因为有必要在您浏览列表并正确设置数据库访问、BaseURL 等后清除缓存的配置.

Several steps involved in cloning or moving a website.

NOTE: It's common practice to empty the var/cache, var/session directories before copying to new location. Clearing cache is mentioned below as it's necessary to clear the cached config after you've run through the list and properly set database access, BaseURL, etc.

  • 将应用程序文件复制到新位置并将数据库导入 MySQL.(最好使用 tarball 和数据库转储 sql 文件来执行此操作,ftp 在传输 .htaccess 文件、案例等方面存在问题.)注意:更复杂的 Magento 管理员使用 rsync,它更容易.

  • Copy application files to new location and import database into MySQL. (best to do this with a tarball and database dump sql file, ftp has issues with things like getting .htaccess files to transfer, case to matter, etc.) Note: more sophisticated Magento admins use rsync, it's far easier.

    (重要!!) 确保文件/文件夹权限和所有者/组正确,以便 var/ 文件夹系统可写.否则 Magento 缓存将写入系统 /tmp 而不是 Magento var/ 并且只有服务器重新启动或手动删除才会从 /tmp .此外,没有 var/writable 意味着将文件写入 var/report/ 的任何严重错误都将无法写入任何堆栈跟踪,从而加剧您的安装心痛.

    (important!!) Make sure file/folder permissions and owner/group are correct so that var/ folder system is writable. Otherwise the Magento cache gets written in system /tmp instead of Magento var/ and only a server reboot or manual deletion will clear Magento cache out of /tmp . Also, not having var/ writable means that any drastic errors that write a file to var/report/ will fail to write any stack traces, compounding your installation heartburn.

    确保 app/etc/local.xml 指向正确的数据库,并确保您备份了它没有的原始 local.xmlt 以 .xml 结尾 -> 需要类似于 local.xml.sv1

    Make sure app/etc/local.xml points to the proper database and make sure if you back up the original local.xml that it doesn't end in .xml -> needs to be something like local.xml.sv1

    更改您的数据库条目 Unsecure BaseUrl for 和 Secure BaseURL 以指向您的新位置(www.example,如果安装了 ssl 证书 www.example).使用 phpmyadmin 在 core_config_data 表中查找路径 web/unsecure/base_url 和 web/secure/base_url.(注意:条目将存在于每个范围集,最小值为全局)

    Change your database entries Unsecure BaseUrl for and Secure BaseURL to point to your new location (www.example and if ssl cert installed www.example respectively). Use phpmyadmin to look for the paths web/unsecure/base_url and web/secure/base_url in the core_config_data table. (Note: entries will exist for each scope set, minimum is Global)

    通过删除 var/cache

    如果您使用的是之前站点上的编译器,请从 Magento 根目录使用 SSH 命令行php shell/compiler.php disable 禁用编译器.

    If you were using the compiler on the previous site, disable compiler with SSH command line php shell/compiler.php disable from the Magento root.

    尝试加载您的管理后端,您现在应该在新的服务器 URL 上.

    Attempt to load your admin backend, you should be on the new server URL now.

    按照这些步骤应该可以清除导致 Magento 坚决重定向回旧服务器的所有问题.相信我,这些事情我都遇到过.

    Following these steps should clear all the hiccups that cause Magento to adamantly redirect back to the old server. And believe me, I've had them all happen.

  • 更多推荐

    将 magento 站点移动到另一个主机,重定向到旧站点

    本文发布于:2023-11-01 17:54:16,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1550009.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:站点   重定向   主机   magento

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!