0

I am seriously at the point of pulling my hair out with this. I'm building a simple internal Wordpress site for viewing files. This is basically a fresh install. The installation is complete up to the configuration of the URL. When I try changing the Wordpress/Site Address from the default localhost, the website access breaks.

What I've tried thus far:

  • 1: Changing the URLs in the WP Panel - Localhost still points to the main page, anything else tries to redirect and does not work.
  • 2: Create a vhost file in apache - either does the same thing as 1 or, if has localhost as it's redirect, gives out a 403.
  • 3: Combine the 2 - Same as 2. Also will sometimes make the browser automatically add a .com to try external sites for some reason.
  • 4: Edit .htaccess - Nothing
  • 5: Delete .htaccess - Also nothing
  • 6: Edit host.conf - Nothing
  • 7: Edit wp-config.php - Same as 1.
  • 8: Combine 1 and 7 - Same as 1.

Everytime the site breaks, I've had to undo or delete the modified files and use PHPMyAdmin to reset the url.

Clearly there is something going on with a redirect or something because it only ever works on the default name that was installed (and now I'm wondering if a full db wipe and reinstall is the final solution, it's a pretty fresh install, there is nothing in it Edit: It didn't). One thing I noticed is that when I try to log back in after the changes is that the URL shown tries to redirect to both the new name but also to the local host for some reason: enter image description here

So yeah, I've been mucking around with this for half a day with no solution in sight. Any possible help?

4
  • this is essentially a server migration with a changed URL, except you skip all the database and server moving parts and go straight to changing the URL. Note that if your server parts are configured specifically for that URL then you will need to get help from your local server vendor on how to change that, e.g. if you're using XAMPP, or if you spun up a docker container, or paid for MAMP Pro etc etc as those parts are outside of WordPress
    – Tom J Nowell
    Commented Jul 11, 2022 at 21:14
  • At which point did you migrate all the URLs in the database? ( by this I don't mean going into the settings page and changing the URL in the box and saving ). Note that just because you can change your WP URL to anything in that box, doesn't mean the server software you installed will automatically pick this up. E.g. if you told WordPress its URL was google.com that wouldn't work, but how would Apache know to start listening for that address? And how would your browser know that it's hosted locally and not to bother going off to the internet looking for it? The answer depends on what you use
    – Tom J Nowell
    Commented Jul 11, 2022 at 21:14
  • Hi @TomJNowell, I probably should've mentioned it in my post but this is basically a desktop install in an OpenSUSE VM with a plain old LAMP stack. As mentioned in my post, this is only for internal use. As such, it does not need to be propagated to the wider internet (and in fact MUST NOT be). Literally all I need is the following two things: 1. Localhost access. 2. Internal network access. The thing is, I know I've done it before and it worked, but I do remember it was a major pain for it to happen. Commented Jul 12, 2022 at 14:12
  • @TomJNowell everything I've searched and basically every blog tutorial I could find (granted, most of them use Ubuntu) can be resumed as "Install LAMP, Install Wordpress, change URL in cpanel" and apparently magically just works. If the issue is that I'm using SUSE and not Ubuntu I can try again with it (even though I seemingly configured the firewall properly so it shouldn't be the issue). Commented Jul 12, 2022 at 14:26

1 Answer 1

0

So turns out, in /etc, there is the host.conf file and the hosts file.

Yes, it was that stupid.

Case closed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.