更改 magento 系统上的 root_dir
我想创建另一个 magento 实例用于开发目的。
我已经复制了站点和数据库,并更改了数据库的连接字符串。
但是,当我登录 magento 时,它会重定向到实时站点 www.example.com,而不是转到测试 url test.example.com。
两个实例都存在于同一个盒子上。
经过一番挖掘后,我认为我需要更改 root_dir,但不确定在哪里更改它。
有人可以帮忙吗?
谢谢 Tom
- 编辑 -
我已经更新了数据库中的两个相关字段,但所有 url 仍然指向生产环境。
我是否必须运行特定脚本才能更新整个站点上的所有这些内容?
-- 编辑 2 --
表中两个 url 的实例不止一个,更新这些实例并从 var 文件夹中删除缓存和会话目录后,一切正常。
I want to create another instance of magento for development purposes.
I've copied the site and the database and changed the connction string for the database.
However, when I go to log in to magento it re-directs to the live site www.example.com rather than going to the test url test.example.com.
Both instances exist on the same box.
After a bit of digging arund I think I need to change the root_dir, but not sure where to change this.
Can anyone help?
Thanks
Tom
-- Edit --
I've updated the two fields in question in the database, but all urls still point to the production environment.
Do I have to run a specific script to update all of these across the whole site?
-- Edit 2 --
There was more than one instance of the two urls in the table, after updating these and deleting the cache and sessions directories from the var folder everything worked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要编辑数据库表“core_config_data”。查找路径为“web/secure/base_url”或“web/unsecure/base_url”的记录,您将看到在哪里更改 URL。您可能需要清除缓存。
毕竟您不需要更改 root_dir,因为这是自动的。
You need to edit the database table "core_config_data". Look for records with a path of "web/secure/base_url" or "web/unsecure/base_url" and you will see where to change the URL. You may need to clear the cache.
You don't need to change root_dir after all since that is automatic.