2017-06-06 73 views
0

我已經下載我的網站文件和數據庫從現場服務器到XAMPP。 我用config_core_data替換了數據庫細節和URL。 另外,mod_rewrite已打開。 只有主頁正在工作。Magento本地主機只有主頁工作

產品鏈接和管理以及鏈接到我的生活網站鏈接。 這裏是我的.htaccess文件

# All explanations you could find in .htaccess.sample file 
    DirectoryIndex index.php 
<IfModule mod_php5.c> 
    php_value memory_limit 768M 
php_value max_execution_time 18000 
php_flag session.auto_start off 
php_flag suhosin.session.cryptua off 
</IfModule> 
<IfModule mod_php7.c> 
php_value memory_limit 768M 
php_value max_execution_time 18000 
php_flag session.auto_start off 
php_flag suhosin.session.cryptua off 
</IfModule> 
<IfModule mod_security.c> 
SecFilterEngine Off 
SecFilterScanPOST Off 
</IfModule> 
<IfModule mod_ssl.c> 
SSLOptions StdEnvVars 
</IfModule> 
<IfModule mod_rewrite.c> 
Options +FollowSymLinks 
RewriteEngine on 
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
RewriteCond %{REQUEST_METHOD} ^TRAC[EK] 
RewriteRule .* - [L,R=405] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule .* index.php [L] 
</IfModule> 
AddDefaultCharset Off 
AddType 'text/html; charset=UTF-8' html 
<IfModule mod_expires.c> 
ExpiresDefault "access plus 1 year" 
ExpiresByType text/html A0 
ExpiresByType text/plain A0 
</IfModule> 
RedirectMatch 403 /\.git 
<Files composer.json> 
    order allow,deny 
    deny from all 
</Files> 
<Files composer.lock> 
    order allow,deny 
    deny from all 
</Files> 
<Files .gitignore> 
    order allow,deny 
    deny from all 
</Files> 
<Files .htaccess> 
    order allow,deny 
    deny from all 
</Files> 
<Files .htaccess.sample> 
    order allow,deny 
    deny from all 
</Files> 
<Files .php_cs> 
    order allow,deny 
    deny from all 
</Files> 
<Files .travis.yml> 
    order allow,deny 
    deny from all 
</Files> 
<Files CHANGELOG.md> 
    order allow,deny 
    deny from all 
</Files> 
<Files CONTRIBUTING.md> 
    order allow,deny 
    deny from all 
</Files> 
<Files COPYING.txt> 
    order allow,deny 
    deny from all 
</Files> 
<Files Gruntfile.js> 
    order allow,deny 
    deny from all 
</Files> 
<Files LICENSE.txt> 
    order allow,deny 
    deny from all 
</Files> 
<Files LICENSE_AFL.txt> 
    order allow,deny 
    deny from all 
</Files> 
<Files nginx.conf.sample> 
    order allow,deny 
    deny from all 
</Files> 
<Files package.json> 
    order allow,deny 
    deny from all 
</Files> 
<Files php.ini.sample> 
    order allow,deny 
    deny from all 
</Files> 
<Files README.md> 
    order allow,deny 
    deny from all 
</Files> 
<Files magento_umask> 
    order allow,deny 
    deny from all 
</Files> 
ErrorDocument 404 /pub/errors/404.php 
    ErrorDocument 403 /pub/errors/404.php 
    <IfModule mod_headers.c> 
Header set X-UA-Compatible "IE=edge" 
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$"> 
    Header unset X-UA-Compatible 
</FilesMatch> 

我都試過,即使更換一個新的。htaccess的,這是行不通的。 有人可以幫忙嗎?

+0

您是否嘗試清除緩存? – Munjal

+0

是的,我刪除了var/cache中的所有內容,但現在情況變得更糟。管理員顯示XAMPP儀表板,我的產品現在已經搞亂了。當我進入產品內部時,我看不到圖片或細節......這真的沒有道理。 – marilena6

回答

0

每當我們從住什麼地方機器&測試在本地: - 1)我們應該只使用普通的.htaccess(指默認的)不是人住一間。 2)在core_config_data表中,我們需要替換2個url安全&不安全 3)在local.xml中請確保數據庫名稱,主機,數據庫用戶名& DB密碼全部正確。在主機中,只使用 - localhost 4)刪除var文件夾本身。 5)檢查文件權限

另請檢查是否有使用CDN。如果活網站正在使用CDN,那麼在本地PC請嘗試更改系統 - >配置 - >常規 - > Web中的媒體網址,皮膚URL地址的值到如下簡單的值:

In Unsecure media url - { {unsecure_base_url}}媒體/ 在安全的媒體網址 - {{secure_base_url}}媒體/

請檢查VAR /在exception.log & SYSTEM.LOG 日誌文件夾,請嘗試解決,如果可能的。 如果仍然沒有任何想法,然後嘗試禁用自定義模塊一個接一個&檢查前端工作是否正常。

另外,還要確保你必須在默認這些事情的.htaccess你使用: php_value memory_limit的768M php_value的max_execution_time 18000

謝謝。