404 links all of a sudden

What issue or error are you experiencing?

After my most recent DB pull some pages are returning 404.

Only notable thing is that the url changes from localhost:10003/page-name to localhost/page-name on the pages that go 404.

I can preview the pages fine from admin and from the Menu editor.

I tried relogging into wp for live links, restarting local, restarting computer.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:
    Version 9.0.3+6684
  • Operating System (OS) and OS version:
    Sonoma 14.5 (23F79)

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @alvarix

You could try a few things to fix this up.

  • Change your Router Mode and Stop/Start the site to see if that helps clean up the domains

  • Re-Save permalinks

  • Using WP-CLI and Open Site Shell you can run manual search and replace jobs to clean up URLs like this:

wp search-replace incorrectdomain correctdomain --all-tables (you can add a --dry-run flag if you want to just check the job first to see how many replacements could be made)

Hi nick.
I tried messing with router mode and resaving permalinks, neither helped.
As for changing the domains, Im not youre understanding - certain pages are stripping off the port after the redirect.
Here’s one row:

Modify ID post_author post_date post_date_gmt post_content post_title post_excerpt post_status comment_status ping_status post_password post_name to_ping pinged post_modified post_modified_gmt post_content_filtered post_parent guid menu_order post_type post_mime_type comment_count
edit 137 2 2024-05-13 18:07:26 2024-05-13 18:07:26 Discover Our Approach publish closed closed discover-our-approach 2024-06-24 14:00:59 2024-06-24 14:00:59 0 http://localhost:10003/?page_id=137 20 page 0
If I paste the GUID into the browser, it returns this address with a 404:
http://localhost/discover-our-approach/

however other links work properly: eg: http://localhost:10003/explore-recommendations/

Theyre coming from a WP nav menu.
Why some work and others dont is baffling,

To clarify are you running into issues only when using Live Links or just when browsing the site from the app like Open Site or when you’re in WP Admin?

If you change your Router Mode to Site Domains is there any difference in the behavior?

I found a fix to the 404s.
I discovered it worked fine in safari (no 404s), so in chrome I disabled extensions and cleared cache and it started working.
I’m guessing maybe adblock but I havent tested each one.

This was happening in regular front end browsing on localhost:10003.

1 Like

Glad to hear it @alvarix thank you for the update!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.