Tag Archive for 'rewrite'

Enabling mod_rewrite in Apache2

Oh my gosh, was I having the worst time ever. Apparently, Apache has restructured their configuration files in version 2. To enable a module, you no longer edit the httpd.conf file. Although I had very little experience with the old way of things, most resources on the web were misleading or useless to me. I did eventually find a forum posting with the answers I needed.

In Ubuntu, run the command a2enmod rewrite to enable the rewrite module. It handles everything for you, and then tells you to restart Apache.

Well, even with this module enabled (as well as proxy, which I read was needed to use RewriteRule in an .htaccess file), things still weren’t working.

The fix was editing the file /etc/apache2/sites-enabled/000-default, changing both instances of AllowOverride None to AllowOverride All.

I haven’t had time yet to consider security risks, but at the moment, I’m just running things locally, so getting it working is my only priority.