Posts Not Found On Server !

Posted November 3, 2014 14k views

I have Ubuntu 14.04 with LAMP stack installed , I also installed Wordpress &
I have created many posts on Wordpress but when I view them it shows not found error. My permalink is set to postname & I have also added Wordpress access rules on .htaccess file !
For example I create sample post with permalink then I get this error :

Not Found

The requested URL /sample-post was not found on this server.

Apache/2.4.7 (Ubuntu) Server at Port 80

I am getting this error for all posts ! My site is showing posts when I go to but when I open any post I get error .
Please help me !

1 comment
  • When I change my Permalink structure to Default then posts appear but something is different means homepage appears not as usual & posts also . The website appears not as usual like The sidebar appears on top , the header image appears twice ,the website UI is looking basic HTML page type !

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

you have to enable Apache Mod Rewrite.
Run these 2 commands via SSH:

a2enmod rewrite
service apache2 restart

Hope it can help.

I had the same issue where posts would redirect to a Not Found Apache error.
This worked for me:
1. Add .htaccess permission to your Apache config file.
Log in as the root user or add writting permissions for the /etc/apache2/apache2.config directory for your current user.

Edit /etc/apache2/apache2.config and add the following tothe bottom of the file.

<Directory /var/www/html>
    AllowOverride All

# Other folders with Wordpress installs: (if any)
<Directory /var/html/beta>
    AllowOverride All

Reset your server by running service apache2 restart.

2. Permalinks update
Log in into your wp-admin panel and navigate to settings > permalinks. There press Save Changes.

I had this problem not too long ago when I transplanted my WordPress installation. I wrote about how to solve the problem on the WordPress StackExchange network.

Please let me know if that solves your problem.

  • In addition to the above suggestion, you may also want to run (from a terminal)

    sudo chown -R www-data:www-data /var/www


    sudo chown -R 775 /var/www

    which will give the apache user permissions on your web files.
    and if you have not already, add your user to the www-data group:

    sudo usermod -a -G www-data $USER
  • I followed your steps & edited /etc/apache2/apache2.conf file & also ran these commands:
    a2enmod rewrite
    service apache2 restart
    Now this error comes :

    You don’t have permission to access /sample-post/ on this server.

  • Now even I can’t access wp-admin !

  • I found the solution !
    Just add these lines
    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ServerName serverdomainnameorIP
    <Directory /var/www/html/>
    AllowOverride All

    on this file sudo nano /etc/apache2/sites-available/000-default.conf
    & then sudo a2enmod rewrite & then sudo service apache2 restart

    Thanks !

port 80 error not found on my site…plz help me solution for my problem..

my website not redirect for another page plz give me the solution