Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

domain.com -> www.domain.com

 
Bill Goldsworthy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

What's the best way to 'correct' an client's URL who is accessing my site via just the domain name, no 'www.' prefix?

I would like to correct to the full 'www.domain.com' just for consistency.

I had thought a Tomcat configuration might take care of it for me, I'd like it to work for whatever URL came into my site.

Many thanks,
Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure it's the best way but one solution would be a filter with a test that looks something like:



I'm sure there would be some other "gotchas" but that's the basic idea.

Also, if you're fronting Tomcat with Apache you might want to look into mod_rewrite
 
Bill Goldsworthy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will look into that!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic