Aye yi yi was this frustrating. For an assignment I had to break my website and then troubleshoot it. I have zero experience troubleshooting, so this was not fun.
To break my DKC training website, I changed both the site URL and WordPress URL from “dkctraining.lexigudgel.net” to different variations of that. The reason this messed up my site is that when you tried to go to my real URL, it got confused and tried to redirect you to those variations which don’t actually exist. I couldn’t even access the backend of my site to rechange the site and WordPress URL.

Let the Googling commence. I had no idea where to start, so I went to online forums, the WordPress online support website, and random articles. From what I could gather, there were several ways to go about this problem. Some articles suggested redirection and others suggested changing the code.




I eventually stumbled across this article:

I have no idea what the wp-config.pfp file is or what it does, but it gave the most detailed instructions so I decided to go with it. Toward the bottom of the article, it explained how to fix the problem I was encountering:
“You may need to change WordPress URLs when moving a WordPress site to a new domain name. […] You can also change these URLs using the wp-config.php file. This comes in handy if you are unable to access the WordPress admin area due to the error too many directs issue. Simply add these two lines to your wp-config.php file:
define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);”
Now, I haven’t the faintest clue how coding works or what any of that means. While it’s definitely not best practice to copy and paste random code you find off the Internet, I trusted this article that seemed to know my exact situation eerily well. So I located the wp-config.pfp file in my file manager and exported it to the Microsoft notepad application.
Once I pasted in those two lines of code, I tried to simply import it back it. Here is where the real frustration set in. I thought that importing it would override the first wp-config.pfp file and replace it with the new code I wanted, right? Wrong. It just added an additional file into my file manager that was called “wp-config.pfp.txt” and did seemingly nothing. I still couldn’t access the front or backend of my site. My best guess is that because I was importing a file saved from the Notepad app, it automatically saved as a txt file that I couldn’t change.
After trying this several times, I was out of ideas. Google wasn’t helpful either. Eventually, I noticed that there was an edit button near the download, import, and export buttons. Duh. So as an incredibly uneducated coder, I decided to edit the wp-config.pfp code directly and see what happened.
Well, at first, nothing. Silly me, that’s because I didn’t change the code from “http://example.com” to my real URL. So I did that. And it still didn’t work. Oh, it’s probably because I didn’t add in the “s” in https. Haha. But it still didn’t work.
Ahh… that would be because I had typed in “dkctraining.lexigudgel.com,” not “dkctraining.lexigudgel.net.” Jeez, this is embarrassing.
FINALLY, I got my website up and running. I could access the front and backend. The only difference is now I can’t go back in and change the site and WordPress URL because I hard coded those in. Well, I don’t plan to do that in the future so I’m not torn up about it. If anything, it’ll stop me from accidentally doing that same thing in the future. Plus, if I ever wanted to for whatever reason, I can just go back into the wp-config.pfp file.
In conclusion, I figured it out, but I think my computer and troubleshooting skills should be used only a last resort to help people.
Leave a Reply