WordPress on Ubuntu 12.10: permalinks problem

I am running a backup of my website on Ubuntu 12.10 (apache+mysql). I can see properly admin and home page, but permalinks are not working (so urls like this are failing: localhost/page/…/).

What I did till now is:

Read More

1) Created file .htaccess via settings->permalinks with the content:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

2) Added rewrite apache module with:

sudo a2enmod rewrite

3) Changed in the file sites-enabled/000-default the row:

AllowOverride None

to:

AllowOverride All

4) Finally restarted apache with:

sudo service apache2 restart

Anyway I am still getting “not found” when I visit a permalink.

How can I make the permalinks work?

Related posts

Leave a Reply

2 comments

  1. If you have already run sudo a2enmod rewrite command but your URL Rewrite is not working.
    To make .htaccess files work as expected, you need to edit this file:

    Step1 : sudo vi /etc/apache2/sites-available/default

    Step2 : Look for a section that looks like this:

        <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
                    # <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # Uncomment this directive is you want to see apache2's
                # default start page (in /apache2-default) when you go to /
                #RedirectMatch ^/$ /apache2-default/
        </Directory>
    
                    # Uncomment this directive is you want to see apache2's
                    # default start page (in /apache2-default) when you go to /
                    #RedirectMatch ^/$ /apache2-default/
            </Directory>
    

    You need to modify the line containing AllowOverride None to read AllowOverride All.

    step3 : sudo /etc/init.d/apache2 reload