开发者

How to set {base_url} in Magento crosses the servers (which are set the code and db)

开发者 https://www.devze.com 2023-04-01 02:42 出处:网络
In Magento, at from core_config_data table, at the moment, I see that we must set base_url ip is 192.168.1.100.

In Magento, at from core_config_data table, at the moment, I see that we must set base_url ip is 192.168.1.100.

If I move it into a another computer it will not work. Why I need to do this? Cause our developers code at their local and commit source code to another server (ip is 192.168.1.113, for example) to automatically build.

So, my question is how to cross server with Magento?

Please, see the below table if you need to have the context.

mysql> select * from core_config_data;
+-----------+---------+----------+-----------------------------------------------------+-----------------------------
| config_id | scope   | scope_id | path                                                | value
+-----------+---------+----------+-----------------------------------------------------+-----------------------------
|         1 | default |        0 | web/seo/use_rewrites                                开发者_Python百科| 0
|         2 | default |        0 | admin/dashboard/enable_charts                       | 1
|         3 | default |        0 | web/unsecure/base_url                               | http://192.168.1.100/
|         4 | default |        0 | web/secure/base_url                                 | http://192.168.1.100/


You can create a new view of your store and assign to it a new base_url. So:

  1. Create a new store view on System » Manage Stores
  2. Go to System » Configuration and select the new store view
  3. On General » Web you can change the base_url

That's all. Be sure that all your products and other things are available for all the store views (by default, it is that way).


If I understand your question correctly, you could solve it with an entry in your hosts file on the developer machines. Instead of using the IP in the URL, you use a FQDN and add that FQDN into the developer's hosts file with either their local IP address or the loopback IP address.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号