2

I am developing a project in Coldfusion with CFWheels MVC Framework with URL Rewriting enabled. It involves user registration and each user should be presented as username.domain.com instead of www.domain.com/users/username. Moreover once I am on username.domain.com all child pages should work as:

  • username.domain.com/page1
  • username.domain.com/page2
  • username.domain.com/search?k=xyz
  • ... etc

which I am unable to achieve.

I have updated my DNS settings of the particular domain so that *.domain.com all point to the same host. What am I still doing? I found this configuration , but I have not figured out how to implement it.

Leigh
  • 28,765
  • 10
  • 55
  • 103
Alfredo
  • 21
  • 1
  • Setting up DNS is only the first step. You also need to set up your web server (Apache, IIS, nginx, etc.) to answer to requests from a wildcard subdomain. – Chris Peters Feb 04 '16 at 18:49

1 Answers1

0

Sorry this is more of an extended comment than an answer

The code has a name of coldfusion-subdomains.cfm but it looks like something that would go into application.cfc. If you look at https://github.com/cfmaniac/CF-SubDomains , it states

CF-Subdomains is a snippet of code (best used in your OnRequest Method of Application.cfc) to detect and include files from a subdirectory on your server and let it act like a subdomain.

So from here, I would go to the cfwheels documentation so see if it does anything special with OnRequest()

I don't see anything that wraps around OnRequest(), so maybe it can be used as is

You may also want to consider url re-writing instead

http://docs.cfwheels.org/docs/url-rewriting

James A Mohler
  • 11,060
  • 15
  • 46
  • 72