1

I run into the same error on each project setup with CraftCMS. So did I this time… again…

First of all: Yes, I seem to be a slow learner. And therefore I can't memorize to rename the htaccess file before calling the Craft installer page. ;)

When downloading CraftCMS the .htaccess file is called htaccess (without leading dot). So, whenever I setup my Craft projects I have to rename the file that is located in /public.

But I always forget about that. I always run into the problem that I get a "503 Service Unavailable" on requesting my new website using Craft. On requesting the admin panel (to start the installer) I get a "404 Not Found". Then I only wonder and ask myself if I have made something terribly wrong…

Only after some hard thinking about what's going on there I come accross the solution: Rename htaccess to .htaccess. Apache is not recognizing the one without dot.

This is happening always (and by "always" I mean each and every single time I start working on a new Craft project) to me and it's totally bothering me.

Why can't Craft jsut come with a correctly named .htaccess file?

Is the public htaccess file maybe named without the leading dot to not be hidden on operating systems like MacOSX? So you can copy files from folder to folder without missing hidden ones? I mean, Craft is made for developers. Come on, guys. Developers should know to have in mind hidden files when copying them to a new project's destination.

So, why just not delivering Craft with .htaccess in /public folder instead of htaccess?

I guarantee you guys that I will forget about the renaming again before calling the URL of my next Craft project.

2 Answers 2

9

Because files that start with a . are considered "hidden" by many file systems (specifically OSX default).

If the file is hidden, then there's a good chance that the user won't know about it, and won't be able to FTP it to the server. It's better for the file to be intentionally misnamed, rather than accidentally hidden.

9
  • 1
    Keep in mind, there are many different skill levels between developers... I don't think it's fair to assume that "all developers know X". As most good companies do, they're trying to lower the barrier for entry to use their product.
    – Lindsey D
    Commented Feb 6, 2017 at 18:08
  • 1
    If you want to discuss the philosophy behind the choice, I'd recommend taking the conversation over to the Craft Slack channel.
    – Lindsey D
    Commented Feb 6, 2017 at 18:22
  • 2
    I don't know if this is the actual reason these days - but as someone who has done quite a lot of support for PHP/MySQL CMS' - leaving the period in the .htaccess about quadruples the support requests. If not more. For people who know what they're doing it is a 1 second change. For everyone else - with that period in front - it is a HUMONGOUS obstacle to adoption and a very frustrating user experience.
    – Lisa
    Commented Feb 6, 2017 at 19:18
  • 1
    Ah. Didn't think about support issues… That makes indeed some sense. Alright, before getting you guys even more on your nerves (just kidding, I could do that all day long) I better mark the answer above as accepted since this actually is the answer. I just hoped there would be some other answer beyond the simple and obvious explanation that hidden files make unexperienced people to not copy them. Lisa made a valid point to me. It's not a good way in the end but it seems to be a better way from a support point of view.
    – Arvid
    Commented Feb 7, 2017 at 12:14
  • 1
    It stinks. But the number of web devs that can't figure it out and give up is almost none. The number of very new people that are just stepping into this and give up - sometimes without even asking for help - is pretty high. Some things are a matter of who will be less inconvenienced/frustrated vs who is most likely to figure it out quickly with only a minimal eyeroll. Losing customers over a stupid hidden file completely stinks - so yea. Support load and customer retention/training all play into it. And other things. Etc? :)
    – Lisa
    Commented Feb 7, 2017 at 18:25
2

It depends on how you run Craft. I use Valet which doesn't work with Apache.

It's basically there if you need it, but it's not mandatory.

1
  • Thanks for your reply. Of course, it's only there for if you need it. But it's named incorrectly if needed. If you don't need it then it's ignored anyway…
    – Arvid
    Commented Feb 6, 2017 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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