【问题标题】:moved domain name - only home page works移动域名 - 只有主页有效
【发布时间】:2012-09-19 16:47:21
【问题描述】:

我将一个站点移至一个 magento 新域名。 主页运行良好,但所有链接都给出 404。

我已验证 httpd.conf 中启用了“*LoadModule rewrite_module modules/mod_rewrite.so*”

.htaccess 有这个条目:

## rewrite everything else to index.php
RewriteRule .* index.php [L]

旧网站

http://old_site.com/                    << this works
http://old_site.com/en/contentpage.html         << this works

新网站

http://newsite.com/shop1/en
http://newsite.com/shop1/en/contentpage.html     << this is a typical link from the home page                                    
                                                 << link from new site takes me here, but this gives 404 error

http://newsite.com/shop1/index.php/en/contentpage.html  < this link, however, does works
http://newsite.com/shop1/en/contentpage.html            << link from new site takes me here, but this gives 404 error

.

【问题讨论】:

  • “来自新站点的链接”是什么样的?它是具有完全限定域名的绝对 URL 吗?它只是一个绝对 URL(以/ 开头)还是一个相对 URL(不以 / 开头),您单击的链接所在页面的 URL 是什么?
  • 您是否更改了数据库中的基本 url 以匹配新域?这是第一个也是最常见的错误。
  • Jon - 我在上面添加了其他信息。
  • cwGeek - 在数据库的设置表中的两个位置更改了基本 URL。 (否则我可能什么都看不到!)

标签: .htaccess magento mod-rewrite hyperlink


【解决方案1】:

根据您提供的描述,在安装过程中似乎没有设置 Use apache rewrites 选项,或者在某个地方迷路了。

core_config_data 表中检查路径web/seo/use_rewrites - 它的值应该是1,如果没有,请将其设置为1。

【讨论】:

  • 后端工作正常,所以我可以在那里检查。使用 Web 服务器重写已启用。
猜你喜欢
  • 2017-06-28
  • 2013-11-05
  • 1970-01-01
  • 2022-01-11
  • 2019-12-25
  • 2018-07-16
  • 2021-06-25
  • 2011-05-31
  • 1970-01-01
相关资源
最近更新 更多