Plugin Author
mvied
(@mvied)
Is the domain you’re trying to map a local domain? Domain Mapping currently only works for external resources hosted on external domains.
Thread Starter
jpleas
(@jpleas)
I’m trying to map from a subdomain to an external domain.
Using Amazon Cloudfront, I’ve got files hosted on S3 that are cloaked by an A name entry in my DNS, giving them the appearance of a subdomain. However, Cloudfront’s SSL doesn’t match my subdomain name, so I wanted to remap it to the name on their SSL cert, which will then serve my file via HTTPS without error.
Plugin Author
mvied
(@mvied)
In the next version I’ll make it so you can map local domains as well. There’s no reason you shouldn’t be able to.
What I want to avoid is people mapping their domains here instead of using a domain mapping plugin. But, I guess I’ll just have to trust people.
Thread Starter
jpleas
(@jpleas)
Gotcha. I understand. And thank you!
Since I can’t yet test your implementation, let me ask — I’m assuming that there’s some sort of conditional statement so that it only remaps when viewing in https. Is that correct?
In other words, if I view http://www.website.com — no domain mapping
But when I view https://www.website.com — domain mapping in effect
Do I understand rightly how you wrote it?
Plugin Author
mvied
(@mvied)
It’s not quite that simple, but that is the end result.
I created a generic filter called ‘https_external_url’ here that is simply a filter for any HTTPS external element. Then, in my domain mapping module I use that filter for the domain mapping here. This code will only be run when securing elements on an HTTPS page.
Plugin Author
mvied
(@mvied)
In my development version I’ve recoded Domain Mapping into URL Mapping. It should do everything you need now. If you could test it for me, that would be cool. Thanks.
Thread Starter
jpleas
(@jpleas)
Absolutely. I won’t be able to install it until Monday though.
Plugin Author
mvied
(@mvied)
No problem. I’m going to take my time with this version, so it’ll probably be a while before release. I’ve got a few other projects running parallel with it and some of the work I’m doing there is being ported into WordPress HTTPS.
Thread Starter
jpleas
(@jpleas)
Well, I uploaded and installed it. No functionality is broken by the dev version that I can tell, but the URL mapping didn’t seem to work for me.
Below is a screenshot of how I have it set up.
https://dl.dropbox.com/u/5697347/mapping.jpg
When I visit http://www.mysite.com/example, it loads images from http://directory.mysite.com which is the subdomain hosted on Amazon S3.
The behavior I’m expecting is that when I visit https://www.mysite.com/example and it loads an image (e.g., http://directory.mysite.com/example.jpg, it will be redirected (prior to load) via your URL mapping to https://directory.s3.amazonaws.com/example.jpg
Am I right in understanding that this is the intended behavior of the new URL mapping? Or did I miss something big picture?
Thanks so much!
I installed the dev version and posted at:
http://ww.wp.xz.cn/support/topic/trying-to-setup-url-mapping-with-ver-340b?replies=1
@jpleas – It looks like we are trying to achieve similar mapping. Can you please take a look at my post? Thanks! Jxff
Plugin Author
mvied
(@mvied)
@jpleas Yes, you have the right idea. Would you mind if I took a look at your setup? I see no reason that configuration shouldn’t work. You can email me at mike[at]mvied[dot]com, if so.
I am also experiencing issues with domain mapping with slightly different result. I get an error displayed on the website:
Warning: preg_match() [function.preg-match]: Unknown modifier ‘a’ in *********/wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/DomainMapping.php on line 43
Any help would be greatly appreciated!