Forum OpenACS Development: Adding www to host node mapped URLs automatically?

http://cvs.openacs.org/cvs/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl?r1=1.88&r2=1.87

Malte added this change, which on the surface makes sense, but does not apply in all situations.

Not all host node mapped URLs will work with/without www prepended to the URL and this should not be magically setup without configuration by the site administrator. In reality the issue is that admins should be able to setup more than one URL for a host node mapping, and probably have a "canonical" host name for the mapping, the same as we do for a regular site. That is, you can use forcehostp to redirect to the preferred URL whether or not the user types "www.host.com" or "host.com".

Collapse
Posted by Malte Sussdorff on
I would agree, but there is also the issue of having multiple subdomains living as hosts. So malte.openacs.org should work as well as www.malte.openacs.org. Having this setup in a canonical way will not work.

But if you think that we should make a difference if a user types "www" in front or not (something which really annoys me a lot if I get to a different page, just because I added / forgot to add www), then we can make this a parameter. But in my opinion it should be a best practice for the users not having to differentiate.

Either way, making it a parameter probably makes sense.

Collapse
Posted by Tom Jackson on
Why not just add a checkbox on the form where you create the mapping to indicate you also want to create the www mapping?
Collapse
Posted by Dave Bauer on
Tom,

Makes sense to me.

Maybe I do not understand your problem Malte, but why not just use a DNS alias (CNAME) record for your specific issue?
Collapse
Posted by Tom Jackson on
Carl,

It has nothing to do with DNS, what happens is that a HTTP request sends a Host header. This is mapped to a subsite, or some subdirectory of the main site. Obviously if DNS isn't setup correctly for the subdomains, the request will never arrive at the correct OpenACS instance. The overall effect is that one OpenACS instance can serve different websites.