Wordpress posts redirects to home

Posted October 8, 2018 1.5k views
WordPressUbuntu 16.04

I have a website with a php application running on a droplet Ubuntu 16.

In the /blog directory there is a Wordpress installed running quite fine.

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!

Any idea what is happen? Thanks.

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
1 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.