Pergunta

Overview

I'm currently implementing a multiple environment plug-in for the CodeIgniter framework as a learning experience; however, I have run into an issue which could be solved multiple ways. I am unsure of which approach [is best] to take, hence this question. I've done a quick search of Stack Overflow and the Web on this subject and have found little definitive results.

Problem

When developing a website you generally have a setup which mimics a similar structure to this: Local - Testing - Live. In having this structure you'll almost certainly have a domain structure to be able to view the website in their different environments, whether this be a prefixed structure, or suffixed.

Question

What method of defining a URL for each of the above environments is best practise, is it the prefixed approach:

  • local.site.com
  • test.site.com
  • site.com

or the suffixed approach:

  • site.local
  • site.test
  • site.com

Even if the outcome of this question is that I should provide support for both prefixed and suffixed, it would still be beneficial to know which is the best practise to use.

Foi útil?

Solução

I think it's a matter of taste, my thoughts on it - .local is non-existing TLD, and it is a common practice to use .local for local resources. If your dev/test sites don't need to be globally accessible, it seems OK to use it, but if you ever want to show this site to someone from outside, he will not be able to reach it. Unlike .local, .test is a non-existent TLD which nobody uses so far, but one day it may be assigned and your .test sites will conflict with other sites, I'd never use it.

While site.com is your domain, you are free to define any subdomains inside it, and decide which subdomains you want to publish on a globally-accessible DNS server etc..

Personally, I prefer prefixes.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top