Magento1 /Magento2 Url修改与域名配置

1.Apahche2 服务器域名配置好之后,就可以修改存放到数据库的url路径。

域名配置参考:https://www.yshuq.com/?p=2995

由于网站站点url路径存放到数据库表中的,所以只把域名配置好,打开域名访问的时候会出现错误,解决办法:

找到数据库表 core_config_data ,使用下面命令找到url地址。

select * from core_config_data where value="xxxxxx" \G;

查询出url地址,然后使用update命令更新url。

UPDATE core_config_data SET VALUE='https://test.y.com/' WHERE config_id=2;

例如下面修改:

mysql> select * from core_config_data where value="http://1xx.2x.2xx.xx:8081/" \G;
*************************** 1. row ***************************
 config_id: 2
     scope: default
  scope_id: 0
      path: web/unsecure/base_url
     value: http://1xx.2x.2xx.xx:8081/
updated_at: 2020-12-08 14:14:56
*************************** 2. row ***************************
 config_id: 3
     scope: default
  scope_id: 0
      path: web/secure/base_url
     value: http://1xx.2x.2xx.xx:8081/
updated_at: 2020-12-08 14:15:01
2 rows in set (0.00 sec)

ERROR:
No query specified

mysql> UPDATE core_config_data SET VALUE='https://test.y.com/' WHERE config_id=2;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> UPDATE core_config_data SET VALUE='https://test.y.com/' WHERE config_id=3;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

2 .修改URl除了上面的方法之外,还可以在magento的后台进行修改,其配置信息:

Leave a comment

您的电子邮箱地址不会被公开。 必填项已用 * 标注