简体   繁体   English

.htaccess重定向-正则表达式,用于* .html到wordpress网址

[英].htaccess Redirection - Regex for *.html to wordpress urls

I've moved a static site (*.html) to wordpress with no changes to the urls. 我已经将静态站点(* .html)移到了wordpress上,但未更改网址。

Example: 例:

domain.com/sample-url.html to domain.com/sample-url.html转到

domain.com/sample-url/ domain.com/sample-url/

There are over 200 pages and I'm tired of setting up redirection for each page. 有200多个页面,我厌倦了为每个页面设置重定向。 Is there a regex to put it on .htaccess file to fix this issue? 是否有正则表达式将其放在.htaccess文件中以解决此问题?

Thanks in advance. 提前致谢。

Does this regex work for you? 这个正则表达式对您有用吗?

^(.+?)\.html$

Test: https://regex101.com/r/kks8Di/3/ 测试: https//regex101.com/r/kks8Di/3/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM