简体   繁体   English

使用htaccess从URL中删除点

[英]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 我有这样的网址https://example.com/ECS-.327-12.5-12-C-TR我想重定向到https://example.com/ecs-327-125-12-c-tr删除点形式网址我已经有了将大写转换为小写的代码,这不是问题,但网址中的点是创建问题

i tried with following rule but no luck 我尝试了以下规则,但没有运气

RewriteRule ^([^/] ).([^/] )\\$ /$1$2.html [L,R=301] 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 我真的不明白它应该做什么,但现在它找到了一个点之前的角色,点和点之后的角色

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

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