Forum Moderators: phranque
------------
Options -MultiViews
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)/(.*) /page.php?v1=$1&v2=$2 [L]
------------
Now I have a string 'wedget™' needed to be placed on the url, so I used urlencode() or rawurlencode() function in the php code to encode the string before placing on the url, and then the url will looks like the following:
mysite.com/wedget™/ID123.html
In the file page.php I use $HTTP_GET_VARS["v1"] to retrieve the string, the problem is that the server couldn't pass the string of 'wedget™' to the parameter v1, so the page.php couldn't retrieve the right value of the string.
This happens to some other special string signs as well.
Generally, the server can retrieve the right values for each parameters on any url format if it is not using mod_rewrite, but how to do this under the mod_rewrite?
Thanks for help!
The document that controls what characters may be used in URLs and for what purposes is RFC2396 [faqs.org], cited in the HTTP/1.1 specification [webmasterworld.com].
If you incorporate a method not allowed by those documents, there is simply no guarantee that your site will continue to function in the future, and worse yet, that you will have any indication that it is not functioning -- unless you see the error yourself on your own machine using your ISP, their caching proxy, etc.
You are free to do as you please, of course, and therefore I should point out that mod_rewrite has a 'NoEscape' [NE] flag which may be helpful, and that the rules for using special characters in query_strings are somewhat more relaxed.
Jim