Apache .htaccess 将目录重定向到查询字符串
我想将我网站上的请求从
host.com/directory
重定向到
host.com/?institution=directory
以便用户可以访问我网站的主要级别类别使用目录表示法 我只是很难理解正则表达式,任何帮助将不胜感激
i would like to redirect requests on my site from
host.com/directory
to
host.com/?institution=directory
so that users can access the main level categories of my site using a directory notation
I just have a hard time wrapping my head around the regex, any help would be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以使用
You could use
重写引擎开启
RewriteRule ^([az-]+)$ /?机构=$1 [L,QSA]
RewriteRule ^([az-]+)/$ /?机构=$1 [L,QSA]
RewriteEngine On
RewriteRule ^([a-z-]+)$ /?institution=$1 [L,QSA]
RewriteRule ^([a-z-]+)/$ /?institution=$1 [L,QSA]