简体   繁体   中英

Remove Dots from url using htaccess

I have urls like this https://example.com/ECS-.327-12.5-12-C-TR which i want to redirect to https://example.com/ecs-327-125-12-c-tr removing dots form url i already have code that converts uppercase to lowercase so thats not a problem but dots in url are creating issue

i tried with following rule but no luck

RewriteRule ^([^/] ).([^/] )\\$ /$1$2.html [L,R=301]

the dot stands for any character except newline. i think you have to escape it

RewriteRule ^([^/])\.([^/])\$ /$1$2.html [L,R=301]

i dont really understand what it should do but now it finds the character before a point, the point, and the character after the point

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