Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just installed the LAMP stack on my Ubuntu system.

The redirection is not working for me. I don't know how to fix it. Can anyone help me?

share|improve this question
2  
IMHO this question is not Ubuntu specific and should be migrated to Server Fault. –  Guandalino Jun 12 '11 at 14:35
    
The OP installed Lamp on UBUNTU. How much more Ubuntu specific do you want? –  wojox Jun 12 '11 at 15:36
1  
@wojov: I don't know about this case, but that argument doesn't work. "How can I use this application (on Ubuntu)?" are mostly off-topic. –  user13032 Jun 12 '11 at 17:14
8  
This is not a "How can I use application", but a "how to enable a specific feature in Ubuntu". Apache under Ubuntu uses a different configuration layout in which each module and virtual host is a file in /etc/apache2 and which can be enabled using a2* programs. –  Lekensteyn Jun 12 '11 at 18:58
add comment

1 Answer

To enable it the rewrite module, run "apache2 enable module rewrite":

sudo a2enmod rewrite

You need to restart the webserver to apply the changes:

sudo service apache2 restart

If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit /etc/apache2/sites-available/default:

    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            # changed from None to FileInfo
            AllowOverride FileInfo
            Order allow,deny
            allow from all
    </Directory>

After such a change, you need to restart Apache again.

share|improve this answer
5  
I had more success with AllowOverride All –  Valentin Despa Sep 26 '13 at 9:42
    
Thanks! sudo a2enmod rewrite and FileInfo fixed it for me! –  d-_-b Feb 23 at 21:08
    
For me that file was /etc/apache2/apache2.conf where I found that config entry –  rahmanisback Mar 25 at 14:37
add comment

protected by Community Jan 3 at 16:45

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.