【发布时间】: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