简体   繁体   中英

.htaccess Redirection - Regex for *.html to wordpress urls

I've moved a static site (*.html) to wordpress with no changes to the urls.

Example:

domain.com/sample-url.html to

domain.com/sample-url/

There are over 200 pages and I'm tired of setting up redirection for each page. Is there a regex to put it on .htaccess file to fix this issue?

Thanks in advance.

Does this regex work for you?

^(.+?)\.html$

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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