How to enable mod_rewrite in apache2 (debian/ubuntu)

apache_display

First install the apache with this command:

apt-get install apache2

Now use locate to find if the mod_rewrite.so is availble on your server:

updatedb
locate mod_rewrite.so

it will found in “/usr/lib/apache2/modules”

New apache follow some folders to enable and disable mods so now do this:

cd /etc/apache2/mods-enabled
touch rewrite.load
vim rewrite.load (you may use any editor to edit this file)

Now paste this following line:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Then edit:
/etc/apache2/sites-available/default

Find the following:

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

and change it to

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

and finally restart Apache:

/etc/init.d/apache2 restart

OK, you done :D

About these ads

15 responses to this post.

  1. Posted by Murasame on May 3, 2010 at 4:52 pm

    Just do as ROOT…

    # a2enmod rewrite

    And that should do… creating the rwrite file would be just redundant. The rest is ok.

    Reply

  2. Posted by anonimo on October 31, 2010 at 11:51 pm

    Thanks :)

    Reply

  3. thanks alot … i have been working on this for hours .

    Reply

  4. […] 1- How enable mod_rewrite in apache2 2- URLs amigáveis – esclarecendo dúvidas 3- Ativando o mod_rewrite LikeBe the first to like […]

    Reply

  5. Great one; quite easy to follow through

    Reply

  6. Posted by George on November 22, 2011 at 7:17 pm

    Thanks

    Reply

  7. Thank you!! Helps a lot!!

    Reply

  8. thanks heaps

    Reply

  9. Posted by Manch :) on October 18, 2012 at 10:34 am

    Thank u soooo Much :)

    Reply

  10. Posted by alice on October 25, 2012 at 1:53 pm

    Thank you very much, it’s really helpful

    Reply

  11. I found a working solution in here: http://ubuntuforums.org/showthread.php?t=1843307 dagn it was easy :) . I still hate to admit, that I’ve been trying to find a real way to get nginx working with joomla.

    Reply

  12. […] + PHP + MySQL) no Debian 2- Configurar domínios virtuais do Apache em máquina Linux/Debian 3- How enable mod_rewrite in apache2 4- URLs amigáveis – esclarecendo dúvidas 5- Ativando o mod_rewrite 6- Módulos do Apache: […]

    Reply

  13. Posted by controla on February 12, 2013 at 9:25 pm

    Thank you! perfectly summarized!

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: