正则表达式创建htaccess的的pritty网址网址、正则表达式、htaccess、pritty

2023-09-02 01:09:09 作者:混丗丶小男人

什么是正确的正则表达式

What is the right regex to

创建这个网址:从domain.nl/projecten/scheidingswanden~~V

create this url: domain.nl/projecten/scheidingswanden from

http://www.domain.nl/?module=projectencat&action=scheidingswanden

换句话说:替代变量名模块=和&安培;行动=用斜杠

也有相反的方式 因为的FrontController需要读取GET变量模块和行动

but also the other way around because the frontcontroller needs to read the get variables module and action

我不知道这是否只是htaccess的,但这种逻辑是缺少

I don't know if it's only htaccess, but this logic is missing

感谢,理查德

推荐答案

这可以帮助:

RewriteEngine on
RewriteRule ^([a-zA-Z]+)/(.*)/index.html$ index.php?module=projectencat&action=scheidingswanden

[a-zA-Z]+ = requires one or more alphabetic chars
(.*)      = requires one or more any kind of chars