我正在嘗試將銀河網站從一臺主機服務器移動到一臺新服務器。但是,我一直在網站上發現404錯誤,並記錄錯誤[Wed May 07 15:20:10 2014] [error] [client xxx.xx.xx.xxx]文件不存在:/ home/examplesite/public_html/sys_cpanel,referer:http://xxx.xx.xx.xxx/~examplesite/。將silvertripe網站從一臺服務器遷移到另一臺服務器
該網站使用銀條2.4.5,一切工作正常舊服務器上。新託管公司正在使用編號預覽鏈接,例如http://xxx.xx.xx.xxx/~examplesite/,以確保在關閉實況網站之前該網站正在運行。有人能請我指出正確的方向嗎?謝謝。
這裏是我做了什麼: 1.感動了所有的FTP文件到新的服務器 2.遷移的數據庫 3.在文件夾的mysite通過_config.php數據庫連接 4.改變的.htaccess
這裏是我註釋掉第一行的.htaccess文件,因爲它指向的是實時網站,我也試圖把預覽地址放在(http://xxx.xx.xx.xxx/~examplesite/)中,這也是無效的。
###RewriteRule mambo/ http://www.examplesite.com/ [R=301,L] ###
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_URI} /assets/Uploads/members/ANZJAT [NC]
RewriteCond %{REQUEST_FILENAME} \.(pdf|zip|rar|7z|doc|docx|xls|xlsx|ppt|pptx)$ [NC]
RewriteRule .* filedownloadpermission?file=%{REQUEST_FILENAME}&%{QUERY_STRING} [L,NC]
</IfModule>
### SILVERSTRIPE END ###
這裏是mysite文件夾中的_config.php,我試圖將其更改爲dev,而不是活的也沒有工作。
<?php
global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = array(
"type" => "MySQLDatabase",
"server" => "servername",
"username" => "admin",
"password" => "xxxxxxx",
"database" => "examplesite_database",
);
MySQLDatabase::set_connection_charset('utf8');
Director::set_dev_servers(array(
'localhost',
'127.0.0.1',
));
Director::set_environment_type("live");
SSViewer::set_theme('themename');
Email::setAdminEmail('[email protected]');
Geoip::$default_country_code = "countryname";
DataObject::add_extension('Member', 'MemberExtension');
DataObject::add_extension('SiteConfig', 'CustomSiteConfig');
Security::set_default_login_dest('members');
SortableDataObject::add_sortable_class('EventSession');
SortableDataObject::add_sortable_class('ClientType');
define('NON_MEMBER_TYPE', 'non-member');
Director::AddRules(100, array('filedownloadpermission/$Action/$ID/$OtherID' => 'FileDownloadPermission_controller'));
?>
任何幫助將不勝感激,謝謝。
或者,也許更好,將'RewriteBase /'改爲'RewriteBase /〜examplesite'。在站點上線之後,只需在http:// xx.xx.xx.xx /〜examplesite /'嘗試查看站點時將其恢復即可。 –
謝恩,很抱歉回覆晚了,非常感謝你的提示,它只是解決了我的問題。謝謝。你想在下面回答,所以我可以選擇你的答案嗎?如果沒有,我會晚些時候關閉它。我感謝您的幫助。 – grumpypanda