Project

General

Profile

Bug #2246

Incorrect Domain Mapping within justpublics365.commons.gc.cuny.edu

Added by Jen Jack Gieseking about 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority name:
Urgent
Category name:
WordPress (misc)
Target version:
Start date:
2012-11-12
Due date:
% Done:

0%

Estimated time:

Description

Hi.

In an effort to mask our domain, I incorrectly domain mapped justpublics365.commons.gc.cuny.edu to www.gc.cuny.edu/justpublics365. The site www.gc.cuny.edu/justpublics365 is already domain mapped to that commons url so it's stuck in a loop. I need a super admin to undo my mistake please.

Thank you.
Jen

History

#1 Updated by Jen Jack Gieseking about 9 years ago

Also, the commons site should be masked as http://www.gc.cuny.edu/justpublics365. If that could be done at the same time, it would be important as well. The site will launch publicly on Wednesday. JJG

Jen Jack Gieseking wrote:

Hi.

In an effort to mask our domain, I incorrectly domain mapped justpublics365.commons.gc.cuny.edu to www.gc.cuny.edu/justpublics365. The site www.gc.cuny.edu/justpublics365 is already domain mapped to that commons url so it's stuck in a loop. I need a super admin to undo my mistake please.

Thank you.
Jen

#2 Updated by Matt Gold about 9 years ago

  • Category name set to WordPress (misc)
  • Status changed from New to Assigned
  • Assignee set to Dominic Giglio
  • Target version set to Not tracked

Dom, can you take a look at this as soon as you can? Many thanks.

#3 Updated by Matt Gold about 9 years ago

Jen Jack Gieseking wrote:

Also, the commons site should be masked as http://www.gc.cuny.edu/justpublics365. If that could be done at the same time, it would be important as well. The site will launch publicly on Wednesday. JJG

Hi Jen --

Two things:

1. For the domain mapping to work, we need to work with IT -- both the originating domain and the target have to be set up for this. That's what IT was working on today.

2. Can I ask you to keep one issue per ticket? It helps avoid confusion. Many thanks!

#4 Updated by Boone Gorges about 9 years ago

I've deleted the incorrectly mapped address, so the site is once again accessible at http://www.gc.cuny.edu/justpublics365, which redirects to http://justpublics365.commons.gc.cuny.edu/

I'm afraid that at this time it's not possible to map a URL like www.gc.cuny.edu/justpublics365 onto a Commons blog. Domain mapping is available for URLs like example.com or test.example.com, but not URLs like example.com/test.

#5 Updated by Matt Gold about 9 years ago

Thanks, Boone.

I'm afraid that at this time it's not possible to map a URL like www.gc.cuny.edu/justpublics365 onto a Commons blog.

Are you sure about that? Is the problem on the Commons/WordPress side or on the GC IT side? Can you elaborate?

#6 Updated by Boone Gorges about 9 years ago

The domain mapping plugin requires that A or CNAME records be pointed at the Commons's IP address, so that Apache can do the necessary rewrites. Subdirectories like /justpublics365 do not have separate DNS records. It may be possible for us to write custom rewrite rules, but it can't be done in the context of domain mapping.

#7 Updated by local admin about 9 years ago

Boone is right that domain mapping isn't the recipe here, but what's needed is a reverse proxy.

Charbel and I are working on this now. Hang in there...

#8 Updated by Matt Gold about 9 years ago

Okay -- thanks, guys.

#9 Updated by local admin about 9 years ago

Ok, Charbel and I have setup a reverse proxy for this on a test server and it mostly works.

The one small gotcha is with how the URLs are constructed in WP.
Boone, please shed some light, it seems that WP is adding a trailing slash to URIs like:

justpublics365.gc.cuny.edu/blog gets rewritten as justpublics365.gc.cuny.edu/blog/

What purpose does that serve? Can it safely be disabled for this individual site?

#10 Updated by Boone Gorges about 9 years ago

WP adds the trailing slash as part of its canonical URL schema. It wants to make sure that every resource is available at a single URI, and it so happens that WP opts to make its canonical URI have the slash.

This step in the canonical process can be removed, but it's not trivial for me to do so. Is it something you can easily work around on your end? If not, no sweat, I will take care of it on mine.

#11 Updated by local admin about 9 years ago

Thanks, Boone. I believe we can wrangle IIS into always adding the trailing slash, but have failed on our first attempts. Will give it another run now...

#12 Updated by Dominic Giglio about 9 years ago

I just wanted to chime in here while Andre is working on the IIS reverse proxy.

Boone,

Doesn't this issue also have to do with multisite subdomain versus subdirectory installs? You can setup WP to serve sites via a subdomain OR a subdirectory but not both?

Subdomain: site.example.com
Subdirectory: example.com/site

So I think this issue would require a custom server setup like Andre discusses above because our MS setup is for subdomains not subdirectories, right?

#13 Updated by Boone Gorges about 9 years ago

Dom - No, that shouldn't matter. What's important is that something is in charge of rewriting URLs. Domain mapping does it on the WP end, but that won't work for our purposes. A reverse proxy will allow the Commons to serve the pages as it normally would, but to have the proxy rewrite the URL that the user sees in the location bar. In each case, it's just a matter of matching and replacing base URLs using regular expressions.

#14 Updated by Dominic Giglio about 9 years ago

Ah, and I just noticed something that I missed. The site on our install is justpublics365.commons.gc.cuny.edu. But the original request is to remap this domain to a gc.cuny.edu address. This isn't part of our WP subdomain so there would be no way (or it would be very difficult) for our WP install to rewrite this domain. Which I guess is why we need Andre to setup the reverse proxy, this rewrite is much more complex than a simple "Domain Mapping." It's not a "map" it's truly a complete URL Rewrite?

#15 Updated by local admin about 9 years ago

We have finished successfully testing the reverse proxy on a test server. Now we are coming up with a method for pushing this to production , where the environment is a bit more complex because it's behind a load balancer and has a CMS (Kentico) installed on the root folder.

#16 Updated by local admin about 9 years ago

Oh I forgot to mention one gotcha. In order to get this to work I had to disable content compression on the commons website. There may be a way to disable this for that sub-domain only but I'm not sure yet.

#17 Updated by Boone Gorges almost 9 years ago

Is the issue in this ticket all wrapped up?

#18 Updated by Boone Gorges almost 9 years ago

  • Status changed from Assigned to Resolved

Closing this ticket. Please let us know if more problems arise. Thanks!

Also available in: Atom PDF