Link to home
Start Free TrialLog in
Avatar of aprillougheed
aprillougheedFlag for United States of America

asked on

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.

User generated image
Avatar of LZ1
LZ1
Flag of United States of America image

When you say the .htaccess was "hacked" what do you mean exactly?
Avatar of aprillougheed

ASKER

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.
So what does your .htaccess file look like now? Is it back to normal? Have you tried a wordpress uninstall and reinstall?
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.
ASKER CERTIFIED SOLUTION
Avatar of LZ1
LZ1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.