How to fix 404s on WordPress permalinks
March 4, 2015 5:54 PM   Subscribe

I delivered a website to client which included a WordPress blog. In development, I had permalinks set to show the category and post name in the path. Now the client has it installed on their staging server and the same permalink settings are delivering 404s.

I have tried resetting the permalinks several times, and also killing the .htaccess file and regenerating it. So far nothing has worked. WP version is 4.1.1. Any help would be greatly appreciated.
posted by starvingartist to Computers & Internet (8 answers total) 2 users marked this as a favorite
 
Check to make sure the server settings are the same. Especially mod_rewrite.
posted by pyro979 at 6:26 PM on March 4, 2015


Response by poster: How do I do that?
posted by starvingartist at 6:27 PM on March 4, 2015


Response by poster: So after doing some research, I think it is the mod_rewrite. I will inform the client they need to work this out with their host. I don't have access to the server.
posted by starvingartist at 6:43 PM on March 4, 2015


Useful when talking to a web host / sysadmin to have the WordPress system requirements.

If it's truly the lack of mod_rewrite then the fix is simple for them. If something else report back here.
posted by artlung at 4:09 AM on March 5, 2015


Response by poster: The client told me they enabled mod_rewrite, but it's still not working properly.
posted by starvingartist at 5:47 AM on March 5, 2015


Can you tell if .htaccess files are enabled?

The way to test this would be to add something like:

Redirect /blahblah http://www.metafilter.com/

to your .htaccess file at the root of the public webserver. Then go to the server (say, example.com) and visit http://example.com/blahblah and you should be redirected to MetaFilter from that url.

If that fails, then .htaccess directives are not being read. In the base Apache configuration this is the AllowOverride directive.

As a fallback you might also try the "Almost Pretty" solution in the WP documentation.
posted by artlung at 7:52 AM on March 5, 2015 [1 favorite]


Response by poster: One question... the WP blog is not the root of the site, it is in the /blog/ folder. Would I edit the .htaccess file at the root, or in the /blog/ folder?
posted by starvingartist at 11:06 AM on March 5, 2015


If you have the expectation that the /blog/ folder "masquerade" as being at the root - as in Giving WordPress Its Own Directory, then yes, you would be copying index.php and .htaccess to do that in that specific way.

But I suspect you just want the blog on its own. You want WordPress to run inside /blog/ as in http://www.example.com/blog/ http://www.example.com/blog/page-slug http://www.example.com/blog/ 2015/03/05/a-blog-post are their own thing then .htaccess as it exists in the "/blog/" directory is just fine.

To test .htaccess I'd just try it in a file at the root of the site.

Also, please feel free to MeMail me about this, I could be more helpful looking at the actual site
posted by artlung at 3:32 PM on March 5, 2015 [1 favorite]


« Older Where to find a history of the Purim Spiel?   |   So many novels labelled as "a novel" Newer »
This thread is closed to new comments.