url 变量中的斜线 [英] slashes in url variables
问题描述
我已将我的 Coldfusion 应用程序设置为在页面上具有动态 url,例如
I have set up my coldfusion application to have dynamic urls on the page, such as
www.musicExplained/index.cfm/artist/:VariableName
但是我的变量名有时会包含斜线,例如
However my variable names will sometimes contain slashes, such as
www.musicExplained/index.cfm/artist/GZA/Genius
这导致了一个问题,因为我的应用程序假定变量名称中的斜杠代表网站的不同部分,即艺术家专辑.所以 URL 将失败.
This is causing a problem, because my application presumes that the slash in the variable name represents a different section of the website, the artists albums. So the URL will fail.
我想知道是否有办法防止这种情况发生?我是否需要使用将变量名称中的斜杠替换为另一个字符的函数?
I am wondering if there is anyway to prevent this from happening? Do I need to use a function that replaces slashes in the variable names with another character?
推荐答案
您需要将斜线转义为 %2F
.
You need to escape the slashes as %2F
.
这篇关于url 变量中的斜线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!