.htaccess - 使用 .htaccess 重定向来自外部站点的错误 URL 链接

标签 .htaccess mod-rewrite url-rewriting

我有两个进入 404 页面的入站链接,因为这些链接很松散。我已尝试正常对这些链接进行 301 处理,但没有成功,我相信是因为此外部 URL 使用的字符。

Column<u>Radiators.html

是此外部网站上建议的页面,并且

Column_Radiators.html

是实际页面。

还有

Bath%3Cu%3EFiller.html

在外部网站上以及

Bath_Filler.html

在我们的实际网站上。

如何成功重定向这些页面?

最佳答案

只需在 .htaccess 中添加这些行

redirect 301 /Column<u>Radiators.html /index.html
redirect 301 /Bath<u>Filler.html /index.html

注意:我使用index.html作为默认重定向,但您可以使用自定义404。

关于.htaccess - 使用 .htaccess 重定向来自外部站点的错误 URL 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7567152/

相关文章:

apache - .htaccess 未从 DocumentRoot 目录中正确读取

.htaccess - 如何使用htaccess将url重写为html anchor 标记(#)

php - wordpress 重写和谷歌 SEO 问题

apache - 将 Apache .htaccess 转换为 Nginx

php - 使用 .htaccess 删除 .php 并重定向到其非 .php 版本

apache - htaccess 重定向不起作用

php - .htaccess 301 使用 php get 查询重定向(旧 url 到新更新)

具有多语言支持的 PHP 路由

web-config - Web.config 将一个域重定向到非 https 文件夹,将另一个域重定向到 https 文件夹

javascript - 如何在 JavaScript 中编写一个好的 Caps Lock 检测解决方案?