默认文档

默认文档

问题描述:

好的,我试图将一个网站从客户端的1and1移动到他们自己的服务器。这是一个PHP网站。我移动了所有文件,移动了数据库(包括指向新数据库的文件),并且首页工作正常(包括点击数据库)。默认文档

但是,没有链接工作。他们都指向不存在的文件夹。该网站是某种CMS,也许是WordPress的,也许不是。但很显然,链接中的文件夹并不是真正的文件夹,而是程序为了显示正确内容而键入的内容。

我说Wordpress是因为有一个旧的Wordpress数据库,但据我所知,没有任何对话。

我可以在DB中看到一个称为文件夹的表,其中包含所有不存在的文件夹名称。

我猜测这是一个网站设置问题。也许在PHP.ini或其他配置中。

对不起,如果这听起来有点模糊。客户端不知道它是什么软件,只知道如何使用它。如果您有任何问题,我可以更详细地告诉我,请告诉我。

感谢

的index.php

<?php 
/* 
    Lite MVC Implementation 

    HTTP requests should be redirected to this file if Apache can't find the page in the filesystem hierarchy. 

    EDITING APP PAGES: 
    PHP Page logic in /controller/ 
    HTML rendering in /views/ 
    Additional PHP classes autoloaded from /model/ 

    Edit URI path routes (mapping URL to page logic) by editing /application/router.class.php, function getController 

    Hosting Requirements for CMS: 
     * PHP 5.2.x and later as of February 2010 
     * PECL Extension : HTTP (pecl_http) 
     * /protected/uploads should be writable by Apache 
*/ 

    $site_path = realpath(dirname(__FILE__)); 
    define("__SITE_PATH__", $site_path); 

    include("global/init.php"); 
    $registry->router = new Router($registry); 
    $registry->router->setPath(__SITE_PATH__ . "/controller"); 
    $registry->router->loader(); 
?> 

样本文件夹将是 '服务'。此文件夹中的表中的记录是:

3 0 Services services Manage Services Content 0 2 2 1 0 2 0 2010-02-22 05:50:39 2010-03-09 13:26:13 

的.htaccess

AddHandler x-mapp-php5 .php 
#php_flag session.auto_start "On" 
#php_flag display_errors "On" 

RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ /index.php?rt=$1 [L,QSA] 
+0

数据库表的列表并没有帮助真的。你能否显示主页PHP的一个片段,其中包括一个不起作用的链接?另外,是的,PHP.ini文件可能不正确,但也不要忘记.htaccess文件。 – 2013-03-13 00:45:03

+1

那些不是Wordpress表格。 – Lock 2013-03-13 01:00:35

+0

假设Apache,是mod_rewrite启用/你能确认所有对不存在的文件和目录的请求被重定向到'index.php'吗? – jeroen 2013-03-13 01:42:19

OK,发现了问题。或者我应该说,别人为我找到了它。

刚刚将.htaccess的规则导入网站。

我不知道IIS不使用.htaccess,而是使用web.config。我现在是。

感谢大家的帮助。

这可能是由于

realpath
线。旧主机是基于Linux的主机,可能是Apache,新主机现在是Windows?实际路径函数可能不会返回新主机上正确的文件夹结构。

该网站是否包含在主机上的C:\ inetpub \ www文件夹中,还是在其他地方?如果在其他地方,尝试将网站移到那里,或者至少移入c:\ inetpub中的子文件夹。

如果做不到这一点,看看这个http://david.steadson.com/2008/12/17/migrating-to-a-new-iis7-install-from-iis6/

+0

是的,旧网站是Linux。而且,是的,Windows机器上的新位置是C:\ inetpub \ www \ ...我将在明天尝试一下现实。谢谢。 – 2013-03-13 05:48:16

+0

你非常接近Linux/Windows问题的答案。你可以看到我发布的答案。谢谢。 – 2013-03-13 20:01:18