Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7407571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:44:42+00:00 2026-05-29T05:44:42+00:00

From this post, I am 99% there playframework, can you route on hostname/subdomains? Now,

  • 0

From this post, I am 99% there
playframework, can you route on hostname/subdomains?

Now, I would LOVE to do the following (we have *.dev.alvazan.com and *.dev.alvazan.com pointing to 127.0.0.1 so developers have to be online OR edit their etc/hosts file)…

UNFORTUNATELY, the request object is null so how can I get the full host or domain that was requested???? then our file will work in production, QA, and on a developers machines with no changes. best of all, developers are testing the real routes that will be used in production albeit they are swapped out via this one script that can never change(if only it worked)….

%{ 
  if(request.domain.contains(".dev.")
    || request.domain.startsWith(dev")) {
     alvazan = "dev.alvazan.com"
     premonitionx = "dev.premonitionx.com"
  } else if(request.domain.contains(".demo.")
      || request.domain.startsWith("demo")) {
     alvazan = "demo.alvazan.com"
     premonitionx = "demo.premonitionx.com"
  } else {
     alvazan = "alvazan.com"
     premonitionx = "premonitionx.com"
  }
}%

My routes would then be easily defined as

  • GET {company}.${alvazan}/projects
  • GET {company}.${alvazan}/project/{projectname}

which would be perfect!!!!

of course expanded, the route under the covers is really one of these three then depending on if the app is in prod, dev, or QA

  • GET {company}.alvazan.com/projects
  • GET {company}.dev.alvazan.com/projects
  • GET {company}.demo.alvazan.com/projects

Exactly what we would be looking for.

NOTE: Hacking the playframework for us is a valid option so pointers there if there is no solutions here would be great!!!!! This is my 3rd day now in the framework and I plan on diving into the code but was hoping it would be later, not so soon.

No, I don’t want a way to swap environments…I want one environment to just work in three contexts with never having to change anything(well not for this routes file at least).

thanks,
Dean

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:44:43+00:00Added an answer on May 29, 2026 at 5:44 am

    I think if you just put the following in your routes:

    GET {company}.alvazan.com/projects           /SomeController/method
    

    then when you retrieve company if you had requested blah.dev.alvazan.com then company should be “blah.dev” and you’ll then be able to route based on that

    Alternative you should be able to do the following:

    GET {company}.alvazan.com/projects           /SomeController/method
    GET {company}.{env}.alvazan.com/projects     /SomeController/method
    

    and then add String env to your controller method signature which should separate the env variable within the framework.

    Reference on putting routes on domains for others reading this:
    http://www.playframework.org/documentation/1.1/releasenotes-1.1#routeHost

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From this post How to use ROW_NUMBER in the following procedure? There are two
I have this function from a plugin (from a previous post) // This method
I would like to continue the discussion from this post: GPX Schema validation problems
As I understood from this post , there are some scenarios where foreign keys
Here's Eric Lippert's comment from this post : Now that you know the answer,
I have made a custom UISwitch (from this post) . But the problem is,
Proceeding from this post on histogramming, is there a way to override the histogram
I have followed the Accepted Answer's instructions from this post as regards creating a
All are from this post . What does these statement mean: error(nargchk(5, 6, nargin));
From this post . One obvious problem is scalability/performance. What are the other problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.