用正则表达式或..更改内部链接?

时间:2011-05-10 15:38:37

标签: html regex hyperlink

我有冷融合扩展页面的链接,例如:

/hsl/incs/10/header.cfm

只需要:

/hsl/incs/10/header.html

我只想更改内部链接,以便如果有这样的链接: http://somesite.com/usescoldfusiontoo.cfm

我不希望改变。所以,我想做reg reg,但通过研究找到可能不是最好的方法......任何帮助都会受到赞赏!

1 个答案:

答案 0 :(得分:0)

在.htaccess文件中尝试此操作:

Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteRule ^(hsl/.*)\.cfm$ /$1.html [NC,L,R=301]

这假设您内部重定向/hsl/*.cfm/hsl/*.html