Problems with changing WP_HOME/WP_SITEURL and redirects
-
I have a bit of a tricky problem with the URLs of my pages; my WordPress is hosted at wordpress.com, but it is behind a cloud-based reverse proxy so that, in theory, `mydomain.com/learn` maps to `mydomain.wordpress.com/learn` (the rest of `mydomain.com` is hosted elsewhere).
However, if I load `mydomain.com/learn` in my browser, I’m redirected to `mydomain.wordpress.com/learn`, displaying it as the URL in my browser. If I check the request directly, it’s a 301 redirect returning the WordPress hosted location.
I have tried over and over again to change the `WP_HOME`/`WP_SITEURL` variables – but it seems to do nothing. I have edited them directly using SFTP to add manual values in `wp-config.php`, and changed them by manually editing the values directly in the database using phpMyAdmin, and nothing seems to happen anywhere. After several days, it’s still showing the wrong domain in grayed out textboxes in Settings -> General.
What am I doing wrong? How do I get WordPress to behave appropriately behind the reverse proxy and not try to force redirects to the wrong URLs?
-
@vinceenachescu Hi there, it looks like your site is not hosted with WordPress.com.
Because WordPress.com and WordPress.org are two entirely separate entities, we cannot access files or data for sites that are hosted elsewhere, so WordPress.com staff can only assist with sites that are hosted on our servers.
You can find more information here about the differences between WordPress.org software and WordPress.com: https://wordpress.com/support/com-vs-org/
https://wordpress.org/support/ is a great resource for sites using the open source WordPress.org software, and you can find support for that at: https://wordpress.org/support/forums/
I hope that helps :)
-
Hi, thanks for your response – the distinction between wordpress.com and wordpress.org are now clear to me.
However, I’m pretty sure that my website is indeed hosted through wordpress.com. The original hosted URL of the page is http://mydomain.wordpress.com/, and we are currently paying wordpress.com for hosting.
-
@vinceenachescu when the format of a URL is like so
http://mydomain.wordpress.com/then the website is on a free plan. Therefore it surprises me to read that
we are currently paying wordpress.com for hosting.My understanding is that you are not hosted at WordPress.com after reading this part in your original message:
directly using SFTP to add manual values inwp-config.php, and changed them by manually editing the values directly in the database using phpMyAdminBecause neither of those two is available for WordPress.com users, let alone for the free tier.
Let’s start with what is the URL of your website or what is the name of your account on the WordPress.com platform you need assistance with?
-
After a web search for Temper (from what I read in your publicly available profile here), I found out that you are using Shopify for the homepage: usetemper.com
The other web search result, about Temper Blog, on the other hand re-directs from
https://usetemper.com › learnto:
wp.usetemper.comSee the results below:
https://www.whoishostingthis.com/#search=wp.usetemper.comFinally, the domain seems to be managed or registered with Google Domains:
https://www.whatsmydns.net/#NS/usetemper.comAre we getting closer?
To my understanding, what you need is to have a further look at domain mapping for your existing domain name:
https://wordpress.com/support/domains/map-existing-domain/as well as in changing a site’s address, in the document below:
https://wordpress.com/support/changing-site-address/Hope this helps a bit further, let us know how it goes!
-
The subdomain for the site is certainly using WordPress.com. WordPress.com works best when domains are directly mapped to it, like your subdomain is. That is working as expected. The best Site URL and home URL would be the subdomain, but setting the home as your main site would make sense.
Instead of leading to the /learn page, are you trying to have that redirect land on the WordPress.com hosted site’s main page? Maybe there’s a simpler option if you can describe the end goal for how this should appear.
With the plan on your site, as long as you have an admin role you should be connected to live chat via https://wordpress.com/help/contact. If you don’t have live chat access, the plan owner will!
-
Thanks for looking carefully into this – and yes you are almost entirely correct there.
The main domain is registered with google, and is pointed at a cloud load balancer that acts to map URLs within the domain. The homepage and default URLs are handled by our shopify store, and the blog section and some other content is mapped behind
usetemper.com/learnand a few other URLs.The two problems I am trying to solve here is first that I don’t want visitors who land request
usetemper.com/leanto have their browsers redirected towp.usetemper.com/learn. Which, for some bizarre reason works totally fine for this URL: https://usetemper.com/learn/the-marshmallow-experiment/ but no other URLs.The second and bigger part of this problem is that I don’t want these pages to be “rendered” with the wp.usetemper.com domain, e.g. all of the internal hrefs that are part of the page when it’s displayed.
If I’m not totally mistaken, changing WP_HOME/WP_SITEURL is what I’m supposed to do in this situation.
I’m not trying to associate the usetemper.com directly to the WordPress blog at learnusetemper.wordpress.com, so the “Map Existing Domain” support document does not seem to be what I’m looking for.
Maybe the “Changing a Site Address” is closer, but I absolutely cannot find it. Maybe because I’m an ‘admin’ but not an ‘owner’?
-
This is a unique situation that I’ve never personally seen WordPress.com support. I’ve tagged the topic with modlook for staff to take a look and see if they can offer suggestions.
-
@darciemg Sorry I didn’t see your reply while writing the previous post.
Thanks for also looking into this – I think my post above describes what I’m trying to achieve, I need usetemper.com to have different services (Shopify, WordPress, etc.) accessible through URLs on the same domain. Having WordPress on our main domain is pretty critical for us for discoverability reasons.
-
Hi there!
From what I can see, the subdomain mapped to the WordPress.com site is
wp.usetemper.com, so it’s only expected that this will be the address that shows to whoever visits the site.On WordPress.com, it’s not possible to map a subdirectory, like
usetemper.com/learn, so there isn’t really much you can do from this end.Feel free to log into the account that owns the site (there aren’t any sites under
vinceenachescu), and reach out via live chat with more info about your setup. Our team will have a closer look.
Thanks! -
@vinceenachescu After reading through your replies once more, these parts stayed with me:
I’m not trying to associate the usetemper.com directly to the WordPress blog at learnusetemper.wordpress.comfirst that I don’t want visitors who land request usetemper.com/lean to have their browsers redirected to wp.usetemper.com/learn. Which, for some bizarre reason works totally fine for this URL: https://usetemper.com/learn/the-marshmallow-experiment/ but no other URLs.The second and bigger part of this problem is that I don’t want these pages to be “rendered” with the wp.usetemper.com domain, e.g. all of the internal hrefs that are part of the page when it’s displayed.I think my post above describes what I’m trying to achieve, I need usetemper.com to have different services (Shopify, WordPress, etc.) accessible through URLs on the same domainSlightly worried I’ve made myself a ‘unique’ little problem here…How about approaching it from a different angle?!
WordPress can handle all of that …and then some.
I mean: what about moving the entire usetemper.com website at WordPress.com under the eCommerce plan instead (not sure which plan/services you are using right now).
For reference: https://wordpress.com/pricing/The front page design seen now at usetemper.com can be replicated with the Block Editor.
The part that Shopify now handles can be imported and run through WooCommerce.
The blog can take up its space -and desired URL structure- under https://usetemper.com/learn/
The WordPress.com infrastructure is global with CDN and other goodies included.
And more.The domain mapping can still be with Google without an issue.
Feel free to reach out via live chat with more info about your setup to the staff team for a closer look, like staff-mckluskey mentioned above, but might be worth discussing this alternative with them instead.
Key takeaway: WordPress is not just for blogs :)
Cheers!
- The topic ‘Problems with changing WP_HOME/WP_SITEURL and redirects’ is closed to new replies.