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

使用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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?