Enable Friendly Url in Ubuntu Localhost

After successfully activating Friendly Url in the Microsoft Localhost, will now explain how to enable friendly urls in Linux especially Ubuntu 9.04. Basically the requirement to be able to use the friendly url is the same, which enable the rewrite module on Apache server.

To enable the rewrite module on Apache server with the Linux OS a bit different way compared to Windows OS (Microsoft).
First open the terminal in Applications> Accesories> Terminal, then type

sudo gedit /etc/apache2/sites-available/default (if still using the default root folder)

above command will open a default file with gedit text editor, then replace

AllowOverride None

with

AllowOverride All

as show below in red

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

Save and close gedit text editor.
Back to the terminal and type

sudo a2enmod rewrite (to activate the rewrite module)
sudo / etc/init.d/apache2 restart (to restart apache)

Now the friendly url feature can already digunkan on your local server.

Category: Tips and Tricks
Tags: | |

Newer post:
Older post: