WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Abdulaziz AlJassar
    Member
    Posted 1 year 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 year 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. Abdulaziz AlJassar
    Member
    Posted 1 year ago #

    glad that it helped :)

  4. jaeeun
    Member
    Posted 1 year ago #

    Hi, where can I type in a2enmod rewrite and how can I restart apache?

    Thanks in advance.

  5. Abdulaziz AlJassar
    Member
    Posted 1 year ago #

    jaeeun if you're mac/linux use terminal and then do ssh login or if you have webmin or WHM on ur server search for execute commands, if you're windows try petty or any ssh client.

  6. Kentaro Fischer
    Member
    Posted 10 months ago #

    This solved the issue for me in Windows using WAMP as well. The rewrite_module wasn't enabled in Apache and once that was on the permalinks worked.

  7. LMJdurango
    Member
    Posted 9 months ago #

    Could you please post how this should look when added to the htaccess file?

  8. elizalorente
    Member
    Posted 8 months ago #

    Thank you :)

  9. frankie.yuen
    Member
    Posted 7 months ago #

    Not to say above doesn't work but for such generic question of fixing Permalink with WordPress, a lot of things could have gone wrong.

    FYI if one is using hosting services from some of the popular service providers, there might be a setting in the hosting company's control panel to 'sync htaccess'.

    I have installed WordPress, changed the Permalink settings, and click 'sync htaccess' in my hosting's control panel, wait for 30 seconds, then it works.

    Sadly there seem to be no standardised naming for such thing... I am referring to the web control panel provided by your hosting service provider which needs username / password to login to, in order to manage your hosting environment.

Topic Closed

This topic has been closed to new replies.

About this Topic