webadvanced / Orchard-SiteMap

SiteMap module for Orchard CMS
14 stars 21 forks source link

NAT private port number appended #4

Closed oko2021 closed 11 years ago

oko2021 commented 12 years ago

Thank you for your product.

I'm using Orchard 1.5.1, Advanced Sitemap 1.3.2, IIS7 on w2k8r2.

The site <PublicIP>:80 is NATted to <PrivateIP>:81 and IIS app is listening to <hostname> header at 81. But instead of using http://&lt;hostname>:80 both sitemap.xml and "Add Custom Route" functions are appending private port to the public hostname http://&lt;hostname>:81 This seems to be a behavior by design. Is there a way to force hostname and port?

CPyle commented 12 years ago

Interesting. I'm not sure what could be done about this, as it assumes your urls are generated using the port from the request context and this is generally what you want to have happen.

If you want to fix this yourself just for your current project, you can find the logic for the sitemap.xml route generation in WebAdvanced.Sitemap\Controllers\HomeController.cs line 139.

The custom routes only use this logic for displaying the route preview, but not for any route generation, so they should otherwise be fine.

I'll see about possibly adding a port override in the future.

glgrahamjr commented 11 years ago

I am having the same issue. That is, on the xml version of the sitemap the private port number is being appended to the url. Any update on being able to override this without actually modifying the underlying code? Thanks.

CPyle commented 11 years ago

I'm going to adjust the url generation to use the the host name configured in the site settings. I see now that this is really the way it should have been done from the beginning.

Don't have a solid ETA on when I'll push this but it should be within the next week.

glgrahamjr commented 11 years ago

Any update on how this change is coming along? Thanks.

CPyle commented 11 years ago

I've just released 1.6.0 with this change. It should be on the gallery shortly.