2013-03-13 105 views
0

好的,我試圖將一個網站從客戶端的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

回答

0

OK,發現了問題。或者我應該說,別人爲我找到了它。

剛剛將.htaccess的規則導入網站。

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

感謝大家的幫助。

1

這可能是由於

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