huanix

chown -R huanix /

huanix header image 2

mod_rewrite for Apache2 in Ubuntu Linux Gutsy Gibbon 7.10

December 10th, 2007 · No Comments · Apache2, Gutsy Gibbon, LAMP, Linux

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 initially wrote this quick tutorial for Feisty Fawn 7.04, and I just checked, and it works great in Gutsy Gibbon, 7.10 also. This should also work well for Edgy 6.10 and Dapper 6.06 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 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!)
  4. sudo apache2 -k restart

All done! now Apache and php can create URL’s on the fly – pretty neato!

Tags:

No Comments so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment