url 变量中的斜线 [英] slashes in url variables

查看:29
本文介绍了url 变量中的斜线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆