【发布时间】:2015-06-23 15:50:21
【问题描述】:
我正在运行一个 Magento 站点,需要将一个 google 站点所有权确认文件上传到根目录。当我这样做时,当输入如下 www.website.com/google0564e497cc4446t6.html 时,无法通过 url 访问 html 文件,而是得到一个 404 页面。其他文件格式工作得很好。我的结论是必须有一个 .htaccess 重定向。
这是 .htaccess 内容:
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
## RewriteRule ^(.)ItemDesc.asp?IC=(.)$ $1$2 [L]
## RewriteRule ^supply-items/$ ItemDesc.asp?IC= [NC,L]
RewriteRule ^([^/]*)\.html$ /ItemDesc.asp?IC=$1 [L]
##RewriteRule ^ItemDesc.asp?IC=$ supply-items/ [L,R=301]
RewriteRule test_rewrite\.html http://www.website.com/rewrite_successful.html [R=301,L]
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
事实证明,以前的网站重定向对于维护 SEO 非常重要,所以我不能只删除它们。但是,有没有办法使用 .htaccess 文件对特定的 .html 文件(例如 www.website.com/google0564e497cc4446t6.html)进行例外处理?
谢谢!
【问题讨论】:
标签: .htaccess magento redirect