huanix

chown -R huanix /

huanix header image 2

mod_rewrite for Apache2 in Ubuntu Feisty Fawn 7.04

April 18th, 2007 · 28 Comments · Apache2, HTML formatting, php, Server, ubuntu

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 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!

Incoming search terms:

  • a2enmod mod_rewrite
  • ubuntu apache2 mod_rewrite
  • Ubuntu php mod_rewrite
  • UBUNTU APACHE2 REWRITE
  • mod_rewrite apache2
  • ubuntu apache mod rewrite
  • php mod_rewrite ubuntu
  • apache2 mod_rewrite ubuntu
  • enable mod_rewrite apache2 ubuntu
  • mod_rewrite a2enmod

Tags:

28 Comments so far ↓

Leave a Comment