"Trouble with Local WordPress Link: Getting 'Page Not Found'

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

"Trouble with Local WordPress Link: Getting 'Page Not Found'

Postby jason12345 » 19. August 2023 21:53

"Hello XAMPP Community,

I've been using XAMPP to develop my WordPress website locally, and I've come across an interesting challenge that I'm hoping you could help me out with.

In one of my posts, I've included a link intended to take users to another page on my local site. My site's URL is https://www.desktopbold.com/ for reference. Strangely, every time the link is clicked, it leads to a frustrating 'Page Not Found' error. I've thoroughly checked the URL and the slug of the target page to ensure they are accurate.

To provide a bit more context, this link is supposed to direct to a page with the slug 'target-page'. Despite my best efforts, I haven't been able to figure out what's causing this unexpected behavior.

Could any of you experienced XAMPP users offer your insights on this issue? Your assistance in troubleshooting would be immensely appreciated.

Thank you for taking the time to read and assist!"
jason12345
 
Posts: 1
Joined: 19. August 2023 21:40
XAMPP version: 8.0.28
Operating System: mac os

Re: "Trouble with Local WordPress Link: Getting 'Page Not Fo

Postby Nobbie » 20. August 2023 10:47

What is a "slug"?

Anyway, we need the full link, the full error message, contents of access log and contents of the error log. Without any of these informations nobody can give you any hint.

jason12345 wrote:To provide a bit more context, this link is supposed to direct to a page with the slug 'target-page'.


If have not the slightest idea what is meant by that? Is that a wordpress thing? Dont forget: this is NOT a wordpress forum, we do NOT support 3d party tools like wordpress, joomla etc.

P.S.: Ah, googled a little bit and the URL slug is meant to be the last part of an URL. Didnt know that this is any important thing, as an URL already contains all target informations (incl. the "slug"). So your link looks like https://www.desktopbold.com/target-page or so. Anyway, this information does not provide any help. We still need the full (real!) link, the full error message and the logs.

P.P.S.: I dont think this is a Xampp problem, i think its either a wordpress problem, a configuration problem or a malformed link. There surely is not a general "superbug" in Xampp which generally leads to Page not Found.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: "Trouble with Local WordPress Link: Getting 'Page Not Fo

Postby pauljvallance » 20. August 2023 15:22

Hi,
Am not sure whether this helps but i often transfer my sites from hosts to local in XAMPP so here's a stab at the things that need to be covered.

The URL of your local site is http://127.0.0.1 so if accessing one page from another locally, both should be set to http://127.0.0.1/%postname%,
see permalinks in settings menu in Wordpress admin.

If you've pulled the local site off of your web host then best way to start is to go into local phpmysqladmin and select the database and run the following SQL inder the SQL tab (not the query tab)
Code: Select all
UPDATE wp_options SET option_value = replace(option_value, 'https://www.sitename.co.uk', 'http://127.0.0.1') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://www.sitename.co.uk','http://127.0.0.1');
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.sitename.co.uk', 'http://127.0.0.1');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'https://www.sitename.co.uk', 'http://127.0.0.1');


BTW i run a WP plugin called 'Better search replace' which can go through your whole site and database to replace any URL strings to the correct value.

Next, check that your local .htaccess file is present and correct. If you look in the permalinks section you'll probably see
Error: Your .htaccess file is not writable, so updating it automatically was not possible

I use Transmit FTP app to bypass this security and so I can edit and rename my htaccess file correctly. You can probably do this in Terminal by setting permissions on the file.

if none of this is relevent then next thing is to inspect the forwarding link page in your browsers developer mode 'inspector' to see exactly what link is being generated.

best Paul
pauljvallance
 
Posts: 3
Joined: 20. August 2023 14:35
XAMPP version: 8.2.4
Operating System: OS 12.6.8


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 27 guests