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

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

问题描述

我将我的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

这篇关于网址变量中的斜线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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