Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website which contains several folders, including one called:

bits & bobs

which contains a file called test.txt

However, when I try to navigate to the file, I get a "bad request" message:

If I take out the ampersand, and simply call the folder bits and bobs then it works ok:

I contacted my web host, Arvixe, who replied that it was "not standard convention" to use ampersands in folder names, and that they could not be expected to support it.

Are they right, or is it a bug with their system?

share|improve this question
They are right in that it is not standard convention. However that does not mean it should not work, assuming you use proper encoding. This link might help with that. – Hennes Sep 7 '13 at 23:21
up vote 1 down vote accepted

It is never a good idea to use special characters other than a _ or - in folder names on a webserver as it will cause problems as you've found out. To reference a file with special characters you need to URL encode your link, e.g., /bits%20%26%20bobs/

A space is %20 and an ampersand %26

share|improve this answer
It doesn't seem to work, even when encoded: – Urbycoz Oct 17 '12 at 9:09
So is it not possible to just remove the ampersand? I would actually agree with your hosts, as I've already said, you should really only use underscores and hyphens in your folder names. Some systems might allow certain other characters but it's best to keep it safe. Whereas we think an ampersand is just shorthand for the word and, it could be interpreted as a command by the server. – JoJo Oct 17 '12 at 13:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .