WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#5653 closed defect (bug) (maybelater)

Canonical URLs interfere with proxy host

Reported by: ekennedy Owned by: markjaquith
Milestone: Priority: normal
Severity: normal Version:
Component: Canonical Keywords:
Focuses: Cc:

Description

In our environment we have two separate instances of Apache running. One for a Content Management system and the default system instance. The primary version of Apache (port 80) is assoicated with the Content Management system. WordPress is running under the default system install (listening to port 90). The request for the Wordpress blog is proxied from the first apache (port 80) to the second (port 90). This all worked fine until I upgraded to WordPress 2.3.2. We are now getting in a loop associated with the canonical url feature. I understand the value of causing the non-hostname part of the URL to be consistent, however, would it be reasonable to provide some way to ignore the host and port for situations like we find ourselves in. For now I've installed the plugin to disable the feature.

Thanks.

Change History (5)

comment:1 @isaacschlueter7 years ago

This also is pretty annoying for hosting a test/dev copy of my blog on localhost, or any time a host could have multiple names (a pretty common occurrence.) If I want to show the copy running on my local box to someone (to get their opinion on a new design, for example,) then I need to change the settings, since the hostname that they'll see will be something like "traveling-laptop-80.corp", but when I'm home, it's "localhost" or "sistertrain.local".

To get around this, I had set my blog URL to /foohack.com/, so that it would create links relative to whatever host the browser was seeing. The canonical url feature breaks this, however, because it seems to be pre-pending http:// to the URL.

comment:2 @DD327 years ago

If I want to show the copy running on my local box to someone (to get their opinion on a new design, for example,) then I need to change the settings, since the hostname that they'll see will be something like "traveling-laptop-80.corp", but when I'm home, it's "localhost" or "sistertrain.local".

I get around this by adding this to my hosts file:

127.0.0.1  username.no-ip.com

(c:/windows/system32/drivers/etc/hosts or /etc/hosts on linux)

And set the site url to username.no-ip.com, That way, Locally username.no-ip.com directs to my wordpress install, and online, username.no-ip.com directs to my wordpress install, Its quite handy as all the links work regardless of if its being viewed locally, or remotely, and the links can just be copy/pasted eitherway.

comment:3 @Denis-de-Bernardy6 years ago

  • Component changed from General to Canonical
  • Owner changed from anonymous to markjaquith

comment:4 @ryan5 years ago

  • Milestone changed from 2.9 to Future Release

comment:5 @dd324 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from new to closed

You should correct the contents of $_SERVER so that WordPress "thinks" it's the front end server, it's the simplest and most robust method of doing this.

Note: See TracTickets for help on using tickets.