linux - 重定向 HTACCESS

标签 linux .htaccess

我在使用 htaccess 进行重定向 301 写入时遇到问题。

我将以下文本添加到我的 htaccess.txt,但它不起作用:

Options +FollowSymLinks
#  mod_rewrite in use
RewriteEngine On
//301 Redirect Old File
Redirect 301 http://www.old_site.com/en/about-us/company-profile.html http://www.new_site.com/en/about-us/company-profile.html

我也尝试了以下但没有成功:

Options +FollowSymLinks
#  mod_rewrite in use
RewriteEngine On
//301 Redirect Old File
Redirect 301 /en/about-us/company-profile.html http://www.new_site.com/en/about-us/company-profile.html

错在哪里? 我是否在 robots.txt 中进行更改?

谢谢

最佳答案

将文件名从 htaccess.txt 更改为 .htaccessSTRICTLY 来说,文件的扩展名是 .htaccess 并且没有名称前缀。

关于linux - 重定向 HTACCESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10027549/

相关文章:

php - 如何使用 htaccess 将路径重定向到子域

linux - 如何删除 Perl 语言环境警告

linux - 带有依赖加密的错误Selenium Wire Linux

python - 使用 pip 安装笔记本时出错

.htaccess - 显示不安全内容的 ssl 异常

wordpress - .htaccess RewriteCond %{REQUEST_FILENAME} !-d 不起作用

linux - Linux内核黑客攻击的虚拟环境

linux - 无法找到完整路径 g++ 和 gcc

php - .htaccess 问题,我无法删除 .php

php - 在 ubuntu 13.10 上从 XAMPP 移动到 LAMP 后 htaccess 不工作(在 apache linux 服务器中启用 htaccess)