2014-04-24 130 views
0

我正在從我們的服務器安裝magento到我的本地主機。我想我已經成功地完成了這個過程。但是,css和js文件正嘗試從本地主機的根目錄引用,而不是安裝它的子文件夾。如何在本地主機的子文件夾中安裝magento

我已經沒有任何影響

Delete from core_config_data where path = 'web/cookie/cookie_domain'; 

update core_config_data set value="http://127.0.0.1/xxxx/web/" where path='web/secure/base_url' or path='web/unsecure/base_url'; 

我也刪除了裏面的一切變種成功執行以下兩個SQL命令。

附上兩張圖片顯示問題

source showing the links pointing to root of the localhost my folder structure clearly showing the files are in subfolder/subfolder/web

secure and unsecure config as seen from admin section 更改管理員密碼後,我能夠登錄到管理部分。但是,CSS和JS文件(又名皮膚文件)仍然還在試圖從

http://127.0.0.1/skin... 

引用,而應該作爲

http://127.0.0.1/xxx/web/skin/... 

回答

1

您需要更新基礎URL通常是通過管理實現從這裏:

  • 系統
  • 配置
  • 一般
  • 網絡
  • 不安全/安全
  • 基本URL

由於您的管理員也無法訪問,您將需要從SQL更新:

  • 打開SQL管理軟件
  • 選擇Magento DB
  • 選擇表core_config_data
  • 更新的行所在的路徑等於web/unsecure/base_urlweb/secure/base_url

或運行以下SQL查詢:

update core_config_data 
    set value = 'http://domainname/' 
    where path = 'web/unsecure/base_url'; 

update core_config_data 
    set value = 'http://domainname/' 
    where path = 'web/secure/base_url'; 
+0

我無法訪問管理部分,因爲您可以看到所有js和css文件都是tr要引用根而不是文件夾結構。此外,我已經執行了SQL命令,基本上這樣做 –

+0

執行SQL命令後,確保刪除緩存文件('var/cache/*')。 –

+0

完成。還是同樣的問題。另外,我不能登錄到管理員 –

0

感謝隊友

我可以做以下

解決
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^127.0.0.1$ [NC] 
RewriteCond %{REQUEST_URI} !^/xxx/web/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /xxx/web/$1 
RewriteCond %{HTTP_HOST} ^127.0.0.1$ [NC] 
RewriteRule ^(/)?$ /xxx/web/index.php [L] 
相關問題