php转移服务器时出现问题。

WBOY
Release: 2016-06-23 14:39:13
Original
865 people have browsed it

之前公司有个网站是php做的,用的前端服务器是apache,
后来开发的人员都离职了,然后现在需要把这个站点换到另一台前端为nginx的服务器上
但是转移过去后,发现页面上所有的地址都莫名其妙的多了个 index.php的目录。
结果导致样式,图片链接全部都不能正常显示,想问一下有没有人遇到过这个情况的
这个怎么处理?谢谢。


回复讨论(解决方案)

用了什么框架?nginx的.htaccess以及rewrite rule和Apache不完全兼容。

用了什么框架?nginx的.htaccess以及rewrite rule和Apache不完全兼容。

好象是用了一个叫 silverstripe 的东西做的。

应该是rewrite重写规则失效,或者不兼容,
你的 .htaccess没有起到作用,查看一下,ngix的重写规则是否开启

nginx不支持.htaccess,所以你要把?在.htaccess?的rewrite???入到nginx配置文件里,然後reload一下即可.
另外注意:apache和nginx的rewrite?法不一?,?一?你可以去搜索引擎搜一下二者的差?.

你打开index.php 有什么内容呢?
还有你之前如果是apache,转义到nginx,那么你的伪静态规则要做相应的更改。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!