Wordpress - 404 error on home page

Wordpress installation returns a 404 error instead of the correct Blog home page.

It worked fine until the root directory .htaccess was hacked.  (I've had a lot of trouble with this on all my sites.)

Simultaneously, the Wordpress theme was updated.

I'm not sure which caused the 404 problem.

This is the problem.

Root web page directory is:
www.example.com

Open in new window

Blog is at:
www.example.com/blog

Open in new window


Wordpress is dropping the /blog/ directory, i.e.,
if I want to go to the Blog Contact PAGE
Wordpress is returning
www.example.com/Contact

Open in new window

instead of the correct
www.example.com/blog/Contact

Open in new window


Please see attached file for General Wordpress Settings.

Appreciate your help in advance.

wordpress-setup
aprillougheedAsked:
Who is Participating?
 
LZ1Connect With a Mentor Commented:
It sounds like it could be the .htaccess.  I would try posting it here if you have specific questions.

Or you could replace it with the following:

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

# END WordPress

Open in new window


Good luck with the crisis
0
 
LZ1Commented:
When you say the .htaccess was "hacked" what do you mean exactly?
0
 
aprillougheedAuthor Commented:
Code that sent the browser to a hostgator page was inserted into the .htaccess file.  We did not do it.  someone else gained access and added the code.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
LZ1Commented:
So what does your .htaccess file look like now? Is it back to normal? Have you tried a wordpress uninstall and reinstall?
0
 
aprillougheedAuthor Commented:
Have not tried uninstall and reinstall yet - but think I will have to.

Have crisis in personal life and can't get free to reinstall.

I'm researching Wordpress .htaccess files and how they should be set up, but reinstall is probably best.

Sigh.

Obviously, if Wordpress is missing the subdirectory - it's got to be either the .htaccess or deep in the php code.
0
 
aprillougheedAuthor Commented:
Yes, something happened with the .htaccess.

I used a similiar .htaccess as yours.

But I had to use
www.example.com/blog/
in both the site and wordpress url in the general settings

Then change to permalinks.

It is working for now.  Fingers crossed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.