Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I create a .htaccess file with the text such as ErrorDocument 403 /content/error-docs/403.html and ErrorDocument 404 /content/error-docs/404.html it doesn't work. The file in ubuntu desktop shows "Error" within the icon of the file. However, other .htaccess files work just fine and show "Option" in the icon of the file. Why is it doing this?

I've tried creating the file through terminal with sudo nano, I've tried creating the file with gedit, nothing. It just refuses to work of the text ErrorDocument is in it.

If it has Options All -indexes, for example, it works perfectly. Also worth noting that no .htaccess file works in /var/www, but .htaccess works in any subfolder like /var/www/content/. Except for ErrorDocument, that still doesn't work.

Am I missing something here? Can't figure this out.

EDIT: I managed to fix it, it was just mere folder permissions screwing up.

share|improve this question
To clarify if you add ErrorDocument 404 /content/error-docs/404.html to a previously working .htaccess file and it then stops working? What errors do you get in the log file /var/log/apache2/error.log ? – Richard Holloway Feb 8 '12 at 16:57
@RichardHolloway If I take a previously working .htaccess file and remove it's contents and add ErrorDocument and save it, it doesn't work either. The file icon changes from "Option" to "Error" and doesn't work. – user1104783 Feb 8 '12 at 16:59
@RichardHolloway Also if I add any .htaccess file to /var/www it doesn't work either. It works in subdirectories though, like /var/www/content. The ErrorDocument however doesn't work regardless. – user1104783 Feb 8 '12 at 16:59
1  
You can add what you have found as your own answer and accept it. If you describe how to check and fix the problem, it may help someone else in the future. – Richard Holloway Feb 8 '12 at 17:35
1  
@RichardHolloway I edited my post since I can only post an answer to my own post in 8 hours or so since I'm a new user, which I will do. – user1104783 Feb 8 '12 at 18:17
show 2 more comments

closed as too localized by Luis Alvarado Mar 19 at 0:34

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.