Friday, June 27, 2008

mod_rewrite for Apache2 in Ubuntu Feisty Fawn 7.04

This article is originally from Huanix tutorial site

mod_rewrite is a module for the Apache webserver that allows apache to dynamically change the url of a site using php (or other scripting languages). It seems like a difficult/confusing task at first, but it actually only takes 2 steps in Ubuntu. I’m using Feisty Fawn, 7.04, but this should work well for Edgy and Dapper without any issues. Any code snippets should be typed into a terminal. “sudo” commands require a password, that’s a given.

1. Enable mod_rewrite in Apache

sudo a2enmod rewrite

2. Edit the configuration file.

1. sudo gedit /etc/apache2/sites-available/default
2. line 8 and 12 says “AllowOverride none” ;
3. change it to “AllowOverride All”
4. save and close

3. Okay… one last step — you have to manually restart Apache (or restart your computer!)

sudo apache2 -k restart

Happy Coding!!! :)

No comments: