I'm trying to move all .htaccess rules to httpd.conf. Problem with that is httpd.conf is blank (apparently this is by default-I'm using 12.04).

I checked apache2.conf and found that httpd.conf was included so in theory I guess I could include my rules in httpd.conf??? However, I also read that I can include the rules in /etc/apache2/sites-enabled/000-default.

In my case I am only running one website on the server (although this will change later).


  1. Which file should I place my .htaccess rules into??
  2. Are there any other files that I could store .htaccess rules in???

UPDATE: I don't wish to use .htaccess for my rules, unless there are some really good reasons for doing so.

1 Answer 1


Generally speaking, if your rules are about a single website (or directory), they go in .htaccess (or the site's configuration file in /etc/apache2/sites-enabled/, if it has one) and if they're about the entire server, they go higher up in the global configuration tree...

But it's really up to you. It won't make much difference.

  • Thanks for your answer. I guess I should have been more clear. I don't want to use .htaccess
    – TryHarder
    Commented Nov 27, 2013 at 14:24
  • @moomoochoo Edited. You mentioned it but what's stopping you from using the /etc/apache2/sites-enabled/... configuration? That's a perfectly acceptable place to store site-specific stuff.
    – Oli
    Commented Nov 27, 2013 at 14:27
  • I'm still learning how things work, so I wasn't confident that that was the correct place to put them. By higher up the configuration tree do you mean placing the rules in httpd.conf? Oh yeah, thanks for the edited answer :)
    – TryHarder
    Commented Nov 27, 2013 at 14:30
  • Yeah, or you can create a new file in /etc/apache/conf.d/ and that'll be sucked into the configuration at load.
    – Oli
    Commented Nov 27, 2013 at 14:32
  • Sorry if this is obvious, but just to confirm, placing the rules higher up the command tree would affect all the websites hosted on the server, is that right?
    – TryHarder
    Commented Nov 27, 2013 at 14:38

You must log in to answer this question.

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