使用 .htaccess 将标准请求 Uri 转换为干净的 URL
我的 URL 格式如下:
http://domain .com/checkout/nonce/701fe0f652/order/108/?token=EC-0DS37792JX3680821
我尝试使用 .htaccess 将其转换为干净的 URL:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?token=(.*)$ /index.php/$1/token/$2/ [R]
RewriteRule 不知何故不起作用。我已经使用 http://jakarta.apache.org/regexp/applet.html 并产生精确匹配。
我正在使用 CodeIgniter,并且已经测试直接放置干净的 URL (http://domain.com/checkout/nonce/701fe0f652/order/108/token/EC-0DS37792JX3680821) 没有问题。
有人可以帮助我吗?
谢谢。
此致。
I have a URL with the following format:
http://domain.com/checkout/nonce/701fe0f652/order/108/?token=EC-0DS37792JX3680821
I try to convert it into a clean URL using .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?token=(.*)$ /index.php/$1/token/$2/ [R]
The RewriteRule somehow does not work. I already test that using http://jakarta.apache.org/regexp/applet.html and resulting exact matches.
I'm using CodeIgniter, and already test to put the clean URL (http://domain.com/checkout/nonce/701fe0f652/order/108/token/EC-0DS37792JX3680821) directly with no problem.
Can somebody help me?
Thank you.
Best regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经找到了答案
I have found the answer for it