开发者

'+' symbol in htaccess

I am using htaccess. I try to pass a value in url like 'C++'.

like "http://domain.com/Details/c++/detail.html"

I am retrieving the value in htaccess like

Re开发者_C百科writeRule ^Details/([a-zA-Z_0-9_.,'&/-]+)/(([a-zA-Z_0-9_.,'&/-]+).html)$ index.php?page=$2&id=$1

But it returns only 'c'. Symbol '+' not accepted. I need the the value 'c++'.

Is there any solution?


Try Url encoding the + character.

"http://domain.com/Details/c%25%25/detail.html"


Is it possible to escape it, like http://domain.com/Details/c%25%25/detail.html. (I'm only guessing)


http://domain.com/Details/c%2B%2B/detail.html


A small consolation is: you are not alone. Since this problem is by design in URIs, eben big sites like Google have their problems with it:

http://www.google.com/search?q=c++

This does a search for just “c”.


Try it with the B flag:

RewriteRule ^Details/([a-zA-Z0-9_.,'&/-]+)/([a-zA-Z0-9_.,'&/-]+\.html)$ index.php?page=$2&id=$1 [B]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜