Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
923 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to escape the slashes as %2F.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...