Wordpress posts redirects to home

October 8, 2018 728 views
WordPress Ubuntu 16.04

I have a website with a php application running on a droplet Ubuntu 16. http://addpost.io

In the /blog directory there is a Wordpress installed running quite fine. http://addpost.io/blog

I publish a post on the Wordpress blog, I see on the Wordpress homepage… but when I click ‘Read more’ to see the post entirely, it redirects to the home main website. But the URL is the post URL! https://addpost.io/blog/how-to-get-followers-on-instagram/

Any idea what is happen? Thanks.

1 Answer
unixynet October 8, 2018
Accepted Answer

Try this in your .htaccess in the blog/ folder:

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

You might need to comment out the current rewrite rules that you have there so this new code takes effect.

Have another answer? Share your knowledge.