WordPress Login Redirect Loop: Fix Being Sent Back to wp-login
You type the right password and WordPress sends you back to the login page. The cause is usually cookies, address settings, caching…
When posts return 404 but the home page loads, the rewrite rules are usually the problem. Re-save permalinks, check the server rule, then test plugins.
A WordPress posts 404 error is the problem where the home page loads but every post or page shows “Page not found”. WordPress uses “pretty permalinks”, such as /my-post/, which do not exist as real files, so the web server must hand every request to WordPress through a rewrite rule. When that rule is missing or the stored rewrite rules are out of date, WordPress never gets the request and you see a 404. This guide checks the usual causes in order, from the quickest fix to the server settings.
Go to Settings → Permalinks and click Save Changes without changing anything, which refreshes WordPress’s rewrite rules. If posts still 404, check the server rule: on Apache or LiteSpeed the WordPress block in .htaccess (with mod_rewrite available), on Nginx a try_files directive. Then test plugins and themes that register custom post types or change URLs. Back up before editing server files.
How this guide was prepared: it is research-based. We used the WordPress developer documentation for .htaccess and Nginx and the WordPress FAQ listed under Sources, checked on October 23, 2026. We did not test your server, and where your host controls the rules you may need their help.
A URL like /my-post/ is not a file. The server first looks for a real file or folder; if none exists, it must send the request to index.php so WordPress can find the post. The developer documentation shows the default Apache block: it turns on the rewrite engine and sends any request that is not an existing file or directory to /index.php. WordPress edits this block mainly to support pretty permalinks. Nginx has no .htaccess, so an administrator must add the rule at the server level with try_files $uri $uri/ /index.php?$args; inside the main location / block. Separately, WordPress keeps its own list of rewrite rules, which can go out of date after a plugin or theme change.

.htaccess; Nginx? Check try_files (Step 3).| What you see | Likely cause | Start with |
|---|---|---|
| Home page works, every post gives 404 | Missing server rewrite rule or stale WordPress rules | Steps 1 to 3 |
| Only a custom post type or category 404s | A plugin or theme registered it and the rules are not refreshed | Steps 1 and 4 |
| 404 appeared after a move or a host change | The new server lacks the rewrite rule | Step 3 |
| The 404 page looks like your theme | WordPress handled the request but found nothing | Steps 1 and 4 |
| A plain server error page with no theme | The request never reached WordPress | Step 3 |
Open a post, a page, a category and the home page. If the 404 screen is styled like your theme, WordPress received the request and found nothing; if it is a plain server page, the request never reached WordPress. Note whether only one type (for example a custom post type) fails. Also check that the post is published and that its link has not changed.
Open Settings → Permalinks and click Save Changes, even if you change nothing. This flushes and rebuilds WordPress’s rewrite rules and also rewrites the .htaccess block where the server allows it. With WP-CLI, wp rewrite flush does the rewrite flush. This fixes many 404s after you activate a plugin or change a post type.
On Apache or LiteSpeed, open .htaccess in the WordPress folder and check that it contains the default block between # BEGIN WordPress and # END WordPress, with the rewrite rules that send missing files to index.php. If the file is missing or not writable, WordPress cannot write it; create it from a backup or ask your host. The rules also need mod_rewrite to be active, which the WordPress FAQ lists as a cause of pretty permalink 404s, and you may have to ask your host to enable it. On Nginx, check that the location / block contains the try_files directive and reload Nginx after a change. If you recently moved servers, read how to move WordPress to a new host.
Plugins that register custom post types, change permalinks, add redirects or add security rules can cause 404s. Deactivate them on a staging copy or one at a time, re-save permalinks and test; our guide to finding the plugin that broke your site shows a safe order, and WordPress plugin conflict explains conflicts. Check a redirect or SEO plugin for rules that point at the wrong place, and switch the theme to a default theme to rule out theme code. If the error appears as redirect loops instead, see ERR_TOO_MANY_REDIRECTS in WordPress.
.htaccess like Apache; Nginx needs server-level configuration..htaccess or server rules before a move.The home page is a real route; posts rely on the rewrite rule that sends the request to WordPress.
Yes, if you do not change the structure. It only refreshes the rules.
It can, because old URLs stop working unless redirects exist, so avoid changing it unless needed.
Yes, especially if mod_rewrite or the Nginx rule needs to be enabled on the server.
Re-save the permalinks, check the server rule and test plugins. If posts still return 404, wpallsolution offers an emergency WordPress fix and WordPress maintenance packages. We cannot promise a result without seeing your server setup.
You type the right password and WordPress sends you back to the login page. The cause is usually cookies, address settings, caching…
Most break-ins start at the login screen. Use this practical checklist for passwords, two-step login, admin accounts, attempt limits and HTTPS.
A staging site lets you test updates on a copy before customers see them. Learn how to create one, lock it down…
Black FridayCyber Monday sale
Before you go,
Our biggest discount of the year on the first payment of every maintenance plan.
BF2026 at checkout