【问题标题】:Magento Localhost only homepage is workingMagento 本地主机唯一的主页正在工作
【发布时间】:2017-06-06 10:54:29
【问题描述】:

我已将我的网站文件和数据库从实时服务器下载到 XAMPP。 我替换了 config_core_data 中的数据库详细信息和 url。 此外,mod_rewrite 已打开。 只有主页在工作。

产品链接和管理以及链接到我的实时网站链接。 这是我的 .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 替换为新的,但它不起作用。 有人可以帮忙吗?

【问题讨论】:

  • 您是否尝试过清除缓存?
  • 是的,我删除了 var/cache 中的所有内容,但现在情况变得更糟了。管理员显示 XAMPP 仪表板,我的产品现在搞砸了。当我进入产品内部时,我看不到图片或细节......这真的没有意义。

标签: magento hyperlink localhost


【解决方案1】:

每当我们将任何东西从现场机器带到本地机器并在本地进行测试时:- 1)我们应该只使用普通的 .htaccess (意味着默认的)而不是实时的。 2)在 core_config_data 表中,我们需要替换 2 个安全和不安全的 URL 3) 在 local.xml 中,请确保数据库名称、主机、数据库用户名和数据库密码都正确。在主机中,仅使用 - localhost 4) 删除 var 文件夹本身。 5) 检查文件权限

另外请检查是否有使用CDN。如果实时站点使用 CDN,那么在本地 PC 中请尝试将系统 -> 配置 -> 常规 -> Web 中的媒体 URL、皮肤 URL 和 js 的值更改为像这样的简单值:

在不安全的媒体网址中 - {{unsecure_base_url}}media/ 在安全媒体网址 - {{secure_base_url}}media/

请检查 exception.log 和 system.log 中的 var/log 文件夹 如果可能,请尝试解决该问题。 如果仍然没有任何想法,请尝试逐个禁用自定义模块并检查前端是否工作正常。

还要确保你必须在你使用的默认 .htaccess 中有这些东西: php_value memory_limit 768M php_value max_execution_time 18000

谢谢。

【讨论】:

    猜你喜欢
    • 2019-05-07
    • 2020-05-24
    • 2020-11-03
    • 1970-01-01
    • 1970-01-01
    • 2013-03-21
    • 1970-01-01
    • 2013-06-12
    • 2014-07-25
    相关资源
    最近更新 更多