我使用mod重写(.htaccess)来:
/index.file
发送至/
现在我想将我的网页从/2.html
重命名为/words.html
,/3.html
改为/text.html
等。
RewriteRule ^old\.html$ new.html [R=301, L] --possible script?
使用 301重定向/重写(?)和订单的最佳方法是什么,即我知道以上两个是正确的顺序 - 但这些新的重定向/重写位置在哪里? (首先或在#1和2之后。)
答案 0 :(得分:0)
执行此操作的最佳方法是使用Redirect
指令
Redirect permanent /one http://example.com/two
将它放在.htaccess文件中。 See explanation here
答案 1 :(得分:0)
只需将这些行附加到现有的.htaccess文件中:
RewriteRule ^2\.html/?$ /words.html [R=301,NC,L]
RewriteRule ^3\.html/?$ /text.html [R=301,NC,L]