My server ignores the .htaccess file I have a terrible problem: I have written rubbish within the .htaccess file, in order to break my web site, and cause an error 500. Result: nothing, nothing happens, the web site continues to be online.

That is, the .htaccess file is ignored completely. Why does this happen? I understand that this only has an answer: the Apache server is misconfigured. This is absolutely correct? Or are there other possible causes?

My file system: image 1 and image 2.

Originally the website was hosted on a folder within a server (mydomain.com/folder), and everything worked fine. Now I am migrating the website to another server, but within a subdomain. The features of the new server:


Subdomain: domain.company.com
Apache: 2.4.7 (Ubuntu)
Port: 80
phpinfo: Open phpinfo


UPDATE.

1) DNS. I checked my subdomain with http://whois.domaintools.com/ and http://mxtoolbox.com/SuperTool.aspx. I found no problems.

2) .htaccess. The file contains RewriteEngine on. RewriteBase is commented, because I don't know what to put when a subdomain. Anyway, no matter what I put in the file, it is completely ignored.

3) My settings.php has:


$ Base_url = 'http://domain.company.com'; // NO trailing slash!
There is not $base_path. Does not exist.


I cleared the cache Drupal. I cleared the browser cache. I truncate all tables that start with cache_.

It does not work. The file .htaccess remains ignored. This, I can not enable friendly URLs.
This generally happens when your web server does not have access to make the overrides to your webroot.

Check if your httpd.conf file has something of the following format

&lt;Directory "/Applications/MAMP/htdocs"&gt;
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

&lt;/Directory&gt;


The important piece above is AllowOverride All, which will make possible for your .htaccess file to override the settings.

If you cannot change the settings in this file, I would recommend you to create a .conf file specific to your site (e.g. mysite.conf using the default file 000-default) in on of /etc/apache2/sites-enabled or /etc/apache2/sites-available, and modify the &lt;Directory&gt; tag to point to the root of your site.

Restart Apache in order to make this change visible. The site should now be able to pick up your .htaccess file.