将 *.htm 重定向到 *.php [英] Redirect *.htm to *.php
本文介绍了将 *.htm 重定向到 *.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试找出如何将网站上的所有流量从任何 .htm 地址重定向到页面的 .php 版本.我希望这将是 .htaccess 规则,但我还没有找到任何非常适合我的东西,而且我不是 .htaccess 的最佳人选.
I am trying find out how to redirect all traffic on a website from any .htm address to a .php version of the page. I am hoping it will be a .htaccess rule but I have not been able to find anything that quite fits for me yet and I am not the greatest with .htaccess.
非常感谢任何帮助.
推荐答案
这将在您的 .htaccess 文件中完成这项工作:
This will do the job in your .htaccess file:
RedirectMatch 301 (.*)\.htm$ $1.php
这篇关于将 *.htm 重定向到 *.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文