views:

29

answers:

2

Hello,

I have a problem on my website when i am trying to access a product with a space followed by a slash. It does not work. Just using a space in a articleno works fine, but when the space is followed by a slash it does not work. Any ideas to why this is? Is it the IIS:en not knowing how to route? Or is it the browser treating space, slash as a sign?

Example:

ArticleNo: VT xxx / xx does not work.
ArticleNo: VT xxx/xx works.

I can't just strip the spaces either because other products have got them in their articlenumbers.

The url i am trying to access will be like this.

somestore.com/product/VT XXX / XX/ <- Does not work.

somestore.com/product/VT XXX/XX/ <- Does work.

It is only when space is followed by the slash that it does not find my product.

+1  A: 

If the the product code really contain spaces then url encode you links. The code for space is %20

Ramesh Soni
+1  A: 

I suspect it is the webserver that is not handling this, rather than the browser. What error message are you getting?

A forward slash in a url indicates a subdirectory so in your example, the webserver will interpret VT xxx/xx as the xx file in the VT xxx directory. Having a space precede a slash will confuse the server because a space at the end of a directory name is not allowed.

If the forward slash is part of the product id, you will need to encode the space and the slash in the url and handle that on the server.

Daniel Dyson
I am getting "resource not found", as in that i can't find my products xml file on disc. So probably you are right when saying it isnot finding the directory. Every product is in a directory that starts with that last two in the article name. example on error product. The product 123 / xs should will be in the directory XS/internalArticleNo. So you meen that when sending 123 / xs it will try to find the product xs in the folder 123 / ?
Are you using a routing mechanism such as MVC or url rewriting? If not, the webserver will just interpret somestore.com/product/123 / xs as the default.aspx page in the 'product/123 / xs' folder. Since both leading and trailing spaces are illegal in folder names, it is no surprise that this is failing. Do you have a .aspx page for handling the request? I would suggest the folowing url: somestore.com/product.aspx?id=123%20%2f%20xs %2f is the url encoded forward slash and %20 is the url encoded space character
Daniel Dyson