基于随机密钥的.htaccess重定向
我正在尝试基于随机密钥进行重定向,如下所示: domainnamedotcom/XZI9F01ZmYj4olGAB4Hh
我希望将其重定向到:
http://domainnamedotcom/application .php?i=XZI9F01ZmYj4olGAB4Hh
这是对我来说显然是新领域,我认为这会起作用, 但事实并非如此...
RewriteEngine On
RewriteRule ^([a-zA-Z_]+)/([0-9]+)$ application.php?i=$1
有谁知道如何解决这个问题?
I am trying to do a redirect based on a random key, like this:domainnamedotcom/XZI9F01ZmYj4olGAB4Hh
I would like this to redirect to:
http://domainnamedotcom/application.php?i=XZI9F01ZmYj4olGAB4Hh
This is clearly new territory for me, I thought this would work,
but it isn't...
RewriteEngine On
RewriteRule ^([a-zA-Z_]+)/([0-9]+)$ application.php?i=$1
Does anyone know how to tackle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的密钥只是字母数字,这将起作用。
您的问题是 正则表达式 不是您所需要的。
Assuming your key is only alphanumeric this will work.
The problem with yours was that the regular expression wasn't what you needed.