Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: http://tinyurl.com/9ez6nb4

If I take out the ampersand, and simply call the folder bits and bobs then it works ok: http://tinyurl.com/9hacna4

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

1 Answer 1

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: tinyurl.com/chhtzz6 –  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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.