.htaccess - Magento 使用 302 重定向到基本 url,我如何让它使用 301

标签 .htaccess magento redirect seo magento-1.4

我在 firebug 中注意到,我的 magento 商店的非 www 版本使用 302 重定向到 www 版本。出于 SEO 目的,我希望它使用 301 进行重定向。

我是如何尝试修复它的

我转到“系统”>“配置”>“常规”>“Web”>“Url 选项”,如果请求的 URL 不匹配,我的设置“重定向到基本 URL”设置为"is"(只有 2 个选项:是或否)Magento 1.4 URL Rewrite options

重要提示

我正在使用 Magento v1.4.0.1 我的 .htaccess 文件包含以下关于 URL 重写的内容:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
</IfModule>

如何将重定向方法更改为 301

最佳答案

从 1.6.2.0 开始,似乎有一个选项可以在管理面板中选择重定向方法,无需修改 .htaccess

只需转到系统 -> 配置 -> Web -> Url 选项 并将自动重定向到基本 URL 设置为您的首选方法。

关于.htaccess - Magento 使用 302 重定向到基本 url,我如何让它使用 301,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12317177/

相关文章:

cakephp - "too many redirects"在 heroku 上使用 CakePHP 的 SSL 重定向

http - 哪个浏览器不能使用 header 位置重定向?

url - 从 www 转发到顶级域

.htaccess - HTACCESS 问:如何将index.php?id=directory/index.html 重定向到一个目录?

.htaccess - 从 htaccess 重定向中排除子域

mysql - Magento 2.2.6 到 2.3.2 升级问题

magento - Google Plus 分享按钮显示错误图像

php - html不在wamp中解析为php

html - 文件夹中的 Apache htaccess : Block direct access to index. html

php - 我可以检查 Magento PHTML 文件中的 HTTPS 吗?