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.
- Enable mod_rewrite in Apache
sudo a2enmod rewrite - Edit the configuration file.
sudo gedit /etc/apache2/sites-available/default- line 12 says “AllowOverride none” ;
- change it to “AllowOverride all”
- save and close
- Okay… one last step — you have to manually restart Apache (or restart your computer!)
sudo apache2 -k restart
All done! now Apache and php can create URL’s on the fly – pretty neato!
No Comments so far ↓
There are no comments yet...Kick things off by filling out the form below.