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.
- 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!
Thank you, this solved my problem.
Very helpful. Thanks & cheers!
Thank you. I have been looking for this solution for a while now. Thank you.
Awesome. Huge help.
I have been beating my head against a wall figuring out why PHP5 wasn’t working, this fixed it in 5 minutes. Thanks for the help.
Wow. Thanks a lot.
All the help I could gather up to now was only dealing with apache2.conf ;
editing ‘default’ really was the point.
You just saved my night !
Thank you. It was very useful for me.
regards,
This was very helpful. Thanks.
Student Affairs - Austin » mod_rewrite for Apache2 in Ubuntu Feisty Fawn 7.04 // Jan 10, 2008 at 8:34 am
[...] This article is originally from Huanix tutorial site [...]
Very helpful, thanks for the succinct tip.
gracias, it worked for me
if you want restart apache use sudo /etc/init.d/apache2 restart
Works perfect on Ubuntu hardy Heron, but restarting using “sudo /etc/init.d/apache2 restart”
hi, i have this message, after restart apache2:
~$ sudo apache2 -k restart
apache2: bad user name ${APACHE_RUN_USER}
done
thanks
YUSS
thanks!
Jose… try this:
sudo apache2ctl restart
-
very helpfull post, thanks TC!
thank you tons!
Hi. On my server rule: RewriteRule ^(.+)$ index.php?r=$1 give me : The requested URL /home/pinochet/public_html/sklep/index.php was not found on this server. But this file exist
Very simple and straight to the point.Was exactly what I was looking for!Thanks
Thanks a lot, it solved exactly what I was looking for
Thank you, I solved my problem exactly following steps your wrote
An other time, thank you
THANK A LOOOOOT !!!
it was very helpfull !
Yeah, thank you! Now I can enjoy Magento!!!
Great . Thank you very much.
Thank you! It worked on Ubuntu!