The website I deployed today has a headache for a long time. I tested it normally on my computer, but I only knew it after I checked it. I hope this article will be helpful to you.
When a Chinese character is used in the URL and file name, IIS reports the 404 error. The page cannot be found. Check the program directory structure and find that everything is normal.
If your server is not IIS and the browser is IE, use the default settings ~~ Webpages with Chinese names cannot be accessed.
The reason is that IE converts Chinese to UTF-8, but currently only IIS can recognize it
Solution:
Method 1:
1. Change the Registry
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ inetinfo \ Parameters \ favordbcs
Change the value to 0.
2. restart the computer.
Method 2:
Self-control in the program
'Convert two-byte characters into valid URL transmission strings
Function geturlencodel (byval URL)
Dim I, code
Geturlencodel = ""
If trim (URL) = "" Then exit function
For I = 1 to Len (URL)
Code = ASC (mid (URL, I, 1 ))
If Code <0 then code = code + 65536
If code & gt; 255 then
Geturlencodel = geturlencodel & "%" & left (hex (CODE), 2) & "%" & right (hex (CODE), 2)
Else
Geturlencodel = geturlencodel & Mid (URL, I, 1)
End if
Next
End Function
Method 3:
First in IE tools-Internet Options-advanced, always remove the hooks in the box before the URL is sent in UTF-8
Method 4:
Do not use Chinese file names