I'm having quite a bit of trouble with my custom IUrlProvider implementations. They work great for the primary website -- i.e. http://www.mysite.com/ -- but not when it comes to handling alternate hostnames, like http://subdomain.mysite.com/.
Unfortunately, none of the examples I've seen appear to properly handle nodes with alternate hostnames.
Instead, the back office URL listings for my alternate domain and child nodes currently look like this: *
/test-two3501/path-name/content-name /test-one3501/path-name/content-name 3501/path-name/content-name /test-two3501/path-name/content-name
* Note: 3501 being the current node ID
Unfortunately, I can't find any examples online that include support for alternate hostnames.
Q: How do I ensure that I'm handling the domain portion of the URL properly in all cases??
Custom IUrlProvider w/ Alternate Domains?
I'm having quite a bit of trouble with my custom
IUrlProvider
implementations. They work great for the primary website -- i.e.http://www.mysite.com/
-- but not when it comes to handling alternate hostnames, likehttp://subdomain.mysite.com/
.Unfortunately, none of the examples I've seen appear to properly handle nodes with alternate hostnames.
To illustrate:
I've got a custom UrlProvider which, when given a node whose default URL looks like this:
http://www.mysite.com/path-name/content-name
...modifies the original route to add a virtual path segment, such as:
http://www.mysite.com/test-one/path-name/content-name
In addition, my
GetOtherUrls
method informs the back office of all the available URLs for this node:/test-two/path-name/content-name
http://www.mysite.com/test-one/path-name/content-name
http://www.mysite.com/path-name/content-name
http://www.mysite.com/test-three/path-name/content-name
Now, by default (that is, if I don't register my custom UrlProvider), my back office URLs for my alternate domain look like this:
http://subdomain.mysite.com/path-name/content-name
And so I would expect my custom UrlProvider to provide the following URLs in the back office:
http://subdomain.mysite.com/test-two/path-name/content-name
http://subdomain.mysite.com/test-one/path-name/content-name
http://subdomain.mysite.com/path-name/content-name
http://subdomain.mysite.com/test-three/path-name/content-name
Instead, the back office URL listings for my alternate domain and child nodes currently look like this: *
/test-two3501/path-name/content-name
/test-one3501/path-name/content-name
3501/path-name/content-name
/test-two3501/path-name/content-name
* Note: 3501 being the current node ID
Unfortunately, I can't find any examples online that include support for alternate hostnames.
Q: How do I ensure that I'm handling the domain portion of the URL properly in all cases??
is working on a reply...