How to set up Drupal 7 on Apache/2 without .htaccess files ?

Solutions

In a directory section that refers to your Drupal installation, you can do the following:

<Directory ...>
AllowOverride None
...paste contents of Drupal .htaccess here...
</Directory>

You should be able to take the contents of the .htaccess file, and place them in your httpd.conf. Exactly where depends on how you have your site running in Apache.

If you are using a virtual host, you would place everything inside a <Directory> section that matches your DocumentRoot, inside your <VirtualHost> section for the site.

If you aren't using a virtual host, then everything would (probably) still go in a <Directory> section that matches your DocumentRoot, but I can't remember the last time I didn't use a virtual host, even for servers with a single website on them.

You may get better answers over on ServerFault, as this isn't totally Drupal specific.

Similar questions

Drupal still working without .htaccess file
I'm having a weird problem with my site. Recently I found that one domain (not mine) was pointing to my IP. My IP hosts a system on Drupal 7 (LAMP) and Ubuntu. My site (still in development and only working in my IP) was already indexed by Google with that other domain name, so I decided to block this site with a simple ".htaccess" trick... I can't...
Are there two identical .htaccess files in a Drupal installation?
I run a Drupal Commons site and I'd like to set it up on a new server. When I set this particular site up, I need to replace Drupal's base .htaccess file so that it runs in my server environment. However, this answer states that the .htaccess is present in two places: The .htaccess files (which are present in at least two places) should have the pe...
What code should .htaccess of files directory hold in drupal 7.25?
The module Security Review gives the report my .htaccess in files directory is a security risk because says it has insufficient code to protect the site from anyone wanting to make php edits. However, have checked it with drupal org docs and I can see the .htaccess in files directory matches up with correct security script to keep out any such atte...
.htaccess files when hosting Drupal 6 sites on IIS 7?
I want to run Drupal 6 on our Windows 2008 server using the included IIS 7 web server. There are a few blogs giving various instructions on doing so, but when I try to create Drupal sites and/or active some modules using IIS 7, I get error messages about creating folders and/or missing .htaccess files. It looks like Drupal relies on .htaccess files...
Drupal 7 - .htaccess prepend the domain when sites/default/files is used
I have been asked to update Drupal's .htaccess file to create a rewrite so that all images/files are prepended with the domain. e.g /sites/default/files becomes /sites/default/files I have never even messed with the .htaccess file before so unfortunately I don't even know where I need to start. I would really appreciate it if someone could show me ...
htaccess doesn't block some php drupal files
I'm meeting a problem with .htaccess file. My application is developped with Drupal 7 and I want to block some php files like xmlrpc.php, install.php, update.php.... I try the following snippet but it doesn't work. Thanks PS : - It works with all kind of files except php files . - My Apache version is 2.4.2

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.