Question

Wordpress posts redirects to home

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.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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]
</IfModule>

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