php url 编码和 htaccess 参数
我已经对 url 文本(例如:Ice's Bird)进行了编码,并通过 htaccess 重定向将其作为参数传递给另一个文件,并且 url 如下所示。
http://test.com/nature-pic-Ice%26%23039 %3Bs_bird.php
在上面的网址中,我想要单词 Ice's Bird 作为参数,但我只能获取单引号之前的单词,例如:Ice
我的重定向代码是
RewriteCond %{REQUEST_URI} ^/nature-pic-(.*).php
RewriteRule ^nature-pic-(.*)\.php content.php?tpath=$1 [L]
如何获取网址中的完整单词?
I have encoded my url text (ex: Ice's Bird) and pass it as a parameter to another file via htaccess redirection and the url appears as below.
http://test.com/nature-pic-Ice%26%23039%3Bs_bird.php
In the above url, I want the word Ice's bird as parameter, but I can get only the word before single quote, ex: Ice
My redirection code is
RewriteCond %{REQUEST_URI} ^/nature-pic-(.*).php
RewriteRule ^nature-pic-(.*)\.php content.php?tpath=$1 [L]
How can I get the full word from the url?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该是您的 .htaccess
使用此地址进行了全面测试 nature-pic-Ice's_bird.php 希望它会有所帮助
this should be your .htaccess
fully tested with this address nature-pic-Ice's_bird.php hope it will help