Posts Not Found On Server !

November 3, 2014 3.8k 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 !

3 Answers

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 !

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

a2enmod rewrite
service apache2 restart

Hope it can help.

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

Have another answer? Share your knowledge.