Forums

[resolved] How To Fix Permalink /%postname%/ 404 not found (3 posts)

  1. mac3rbi
    Member
    Posted 3 months ago #

    I've been searching for this issue i had and i managed to fix it gladly with some search but i didn't find anyone fixed it here so

    first of all create .htaccess on your website directory it could be /var/www/yourwebsite or any where you installed wordpress on (just move it beside wp-config.php)
    this tutorial require ssh connection i edited this from Terminal after i connected to my Debian/Linux server

    in command line you can make touch .htaccess and then set permission chmod 666 .htaccess and chown www-data:www-data .htaccess

    then change your permalink to default > save it, and then once again, change permalink back to Post Name
    you should see in .htaccess something like

    # 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

    Now from command line you should enable rewrite_mod by typing (you need to be root)
    a2enmod rewrite

    and then restart apache by
    /etc/init.d/apache2 restart

    and this fixed the issue for me :)
    hope it fixes yours and this is my first english 'how to' tutorial

  2. arasbm@gmail.com
    Member
    Posted 1 month ago #

    Dude! I have been searching for this for the last 3 hours. None of the posts or threads I read mentioned anything about running a2enmod rewrite. But that was the key. I finally have my blog up and running again. Thank you so much!

  3. mac3rbi
    Member
    Posted 2 weeks ago #

    glad that it helped :)

Reply

You must log in to post.

About this Topic