16

I just migrated my ecommerce website (www.getfitkart.com) from shared hosting to Linode. Now only the home page is working but the other pages are not getting served. I am getting the following error on all other pages like say, http://www.getfitkart.com/privacy-policy/

Not Found
The requested URL /privacy-policy/ was not found on this server.

My .htaccess file:

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

Any help will be greatly appreciated.

5 Answers 5

19

Go to settings->permalinks and click on save button to rewrite flush. And then empty your browser cache. It'll work hopefully.

2
  • 1
    This solved the problem beautifully! Thank you! Sep 11, 2019 at 16:24
  • Chiming in here to say that this worked with Wordpress via Docker as well. I had scaffolded a new standard Wordpress via Docker project, imported a MySQL dump into the fresh db (which had permalinks set up), and initially all page links were broken besides the root page. I did not have to empty browser cache; I just went to "Permalinks," hit save, and that did the trick. Aug 22, 2021 at 15:31
9

I found the solution here:

https://www.digitalocean.com/community/questions/wordpress-permalinks-not-working-on-ubuntu-14-04

The thing is that we need to allow the override all option in httpd.conf (location: /etc/httpd/conf/httpd.conf) for your specific hosting directory.

9

Sometimes on a new server it's just the rewrite module missing from Apache config.

sudo a2enmod rewrite
sudo service apache2 restart
1
  • Chiming in here to say that this was the cause of my problem on my DigitalOcean LAMP droplet.
    – Lodybo
    Mar 5, 2023 at 18:14
7

Solved this problem on Linux Mint 19 / PHP Version 7.2.19-0ubuntu0.18.04.1 by changing:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory> 

to:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory> 

in /etc/apache2/apache2.conf.

Hope this helps!

2
  • Diverse tutorials seem not to include the change of handling that going from Apache 2.2 (CentOS 6) to 2.4 (CentOS 7) conveys. The AllowOverride All setting saved my day (CentOS 7, Apache 2.4, WP 4.9) Aug 12, 2020 at 22:11
  • Thanks! I had tried numerous solutions to this problem after migrating to a new server and configuration. These options did the trick.
    – zkarj
    Apr 9, 2021 at 11:23
1

Dear friend after moving site : go to your phone admin Then choose your database. Click on wp-option Change raw 25 to 500 Change site url : http://www.yourwebsite.com search -- path : change path of your upload

Save it Login your site: www.yoursitename.com/wp-admin Go to settings Then go to Permalink Do not change anything Just Save it.

Now try your all page.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.