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 8.04. 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:
Post a Comment