我正在尝试使用特殊字符,URLs
但在理解我应该做些什么以使其正常工作时遇到了一些麻烦。
我见过这样的网址:
http://www.last.fm/music/Simon+&+Garfunkel
http://www.last.fm/music/小林武史
在 Last.FM 上完美运行,但我该怎么做呢?
我已经在这个问题上提出了一些方法,但部分解决了我的问题,这要归功于.htacess
file中的正则表达式帖子(.+?)
,但我在阅读 url 时仍然遇到问题。
如果我写类似的东西http://mysite.com/event/Dance&Jump
并在我的 php 页面中使用:
//.htaccess
RewriteEngine On
RewriteRule ^(event/)(.+?)[/]?$ event.php?event_name=$2
<?
print urldecode ($_REQUEST["event_name"]);
?>
该页面将打印:
//<html> printed page
Dance // "&Jump" is missing, how can I fix it?
//</html> printed page
我希望能够使用几乎所有特殊字符,例如 Last.FM 或 Wikipedia
使用特殊字符 url 和常用程序的技术如何?