dongzhankou2090 2014-09-28 20:02
浏览 574
已采纳

使用ip地址通过Web浏览器访问服务器重定向到localhost

I'm using prestashop to set up an e-commerce website on my cloud server. I was able to successfully install it on the server and it works fine on the server locally, i.e. if I look at the website using localhost on the server. However when I try to access it from a different machine it won't work because, it gets redirected to localhost/index.php? I'm not sure what could be wrong or even where to start looking... any help would be appreciated. Only thing I could think of was the index.php file. It has following 2 lines of code and is generated by prestashop.

I apologize if this is not the correct SO website, as I wasn't sure what the issue could be related to.

Thank you.

  • 写回答

1条回答 默认 最新

  • doudizhi947129 2014-09-29 01:44
    关注

    When moving an CMS to another domain problems like this often occurs. Most CMS saves the domain they should run on in configuration file oder database. If there is an request for another domain they are sending an redirect (HTTP state code 302) back. I think problem here is that this one is set to localhost.

    A short search on google pointed out that prestashop saves a domain name configuration in a mySQL database. Since petrashop 1.5 it should be in a table called PREFIX_shop_url. Before it was saved in PREFIX_configuration as PREFIX_shop_url. But I didn't tested on my own. You should have a look on your own and change the value in database to your new domain.

    You could use mysql command line client to connect to database and change the value. If your are not so familiar with SQL you could also use a GUI like phpmyadmin.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号