Apache server ignores .htaccess
As Jim said, if you have full access to your server, you should just put everything in the server configuration files.
I reached here because I thought my server was ignoring my own htaccess/server configuration files. However, it turned out I had mod_expires and mod_rewrite disabled. After I had those two looked into, everything was working again as it should.
You can enable them by executing these commands:
sudo a2enmod expires
sudo a2enmod rewrite
Then restart apache
service apache2 restart
Hope this helps someone out there!
<Directory "/home/page_url/www/">
AllowOverride None
This AllowOverride None
disables .htaccess
files from being read. See the manual.
Also, please bear in mind that there's nothing magical about .htaccess
files. They are a crude workaround for not having full access to the server configuration. All they are is a piece of Apache configuration. If you have full access to the server configuration, you should be putting stuff like this into the vhost configuration, not .htaccess
files.
One thing to remember if your rewrite rules still don't work:
Also activate the ModRewrite module! It is not by default in Ubuntu.
See other answer here on how to do that.