我在使用 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
更改为 .htaccess
。 STRICTLY 来说,文件的扩展名是 .htaccess
并且没有名称前缀。
关于linux - 重定向 HTACCESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10027549/