Tuesday, December 25, 2012

PHP : mod_rewrite services

Experience working with PHP is really good. But really missed the way rails for handling urls dynamically.
Really feeling nice when I found the way to add such method for dynamic urls.
Just need to use mod_rewrite in .htaccess file for the respective project.

In the beginning didn't work as per the requirement.

After some research found the post enable-mod_rewrite-in-a-ubuntu-server which helped a lot for starting the mod_rewrite services.

By default it showed that mod_rewrite services are running but need some changes in the files which are as below.

Just need to run
sudo gedit /etc/apache2/sites-enabled/000-default
and in <Directory /> and <Directory /var/www/> section change
AllowOverride None
to
AllowOverride All
And then just
sudo /etc/init.d/apache2 restart


No comments:

Post a Comment