1

I run a custom web app, and I've been working towards transitioning it onto Git, but I am running into a file path problem because of the web app's subdomain environments.

The web app is comprised of:

  1. public website at the root-level domain (app.com)
  2. admin area at "my" subdomain (my.app.com)
  3. basic read-only API at "api" subdomain (api.app.com)

Each of those areas have their own sets of templates and routing scripts, but share a common set of classes and top-level configuration files.

When I load up a local copy of the web app in MAMP, most of the public website environment works, but the subdomain environments ("my" and "api") throw "file not found" errors when attempting to include files in the project.

This is because the subdomain environments assume they are their own "root-level" locations. On Git on a local machine, "my.app.com" translates to "app_folder/my" (a subfolder). And a URL like "my.app.com/users/<user_id>" translates to "app_folder/my/users/<user_id>". This is throwing off file paths for the subdomain locations of the web app.

Is there some way to set up equivalent DNS settings on a local machine to make subdomains work on a Git project?

Or maybe there is another setup method I need to learn about?

If it helps to know, the web app is written in PHP.

I'd be grateful for your insight.

lukenjohnson
  • 113
  • 1
  • 10

0 Answers0