What is the correct way to name a subdomain? - web

It is about naming URLs, for example www.example.com/pagename and www.pagename.example.com.
Are they under the same domain name? if so, I don't understand why some websites choose the second option (www.pagename.example.com) for some of their pages instead of keep going with the 'normal' way (www.example.com/pagename).
Are there any advantage or disadvantages of adding the name at the beginning of the URL?

Simply speaking, www.pagename.example.com has subdomains www, pagename and example. There does not appear to be an index/home page specified.
www.example.com/pagename has subdomains www, exmaple. It has a page name in this case specified as it is / forward slash after top level domain.
In answering your question, well that depends on your needs. If you have separate sites or areas of interest "domains" then you can divy it up but still be under one domain mysite.

Related

Same website on same domain name with different extensions - i.e. .com and .co.uk

What is best practice for doing this? Should I have duplicate content at each domain or should I redirect from one to the the other, i.e. all traffic to the .co.uk domain redirected to the .com domain?
Best practice is to send them all to one web server.
By default the server will not care which domain is pointed at it and will show the home page as domainx.com if you to it from domainx.com.
However there are two possible issues with this that come to mind:
The person who created the website hopefully only used relative links. (The contact us button points to contactus.htm instead of http://domainx.com/contactus.htm ) If not, some links might change the user from domainx.co.uk to domainx.com.
Search Engine Optimisation: Its better SEO wise if all the links to your site point to one domain name rather than appearing as several less popular sites.
You can get everyone on the same site by using a RewriteRule or 301 Redirect to the primary site. Or you can make every hyperlink on the site absolute and point to the primary domain.

Is it possible to create a domain with another word before the. and the rest of your URL? (Closed)

so basically I'm trying to make a secondary domain that is about.wyrnz.com and I was wondering if I have to buy another domain or if it is possible to do that without buying a new domain?
Thanks everyone for replying! I've worked it out now so this is now closed!
As soon as you own a second level domain (wyrnz.com), you can create as many sub-levels as you want. That includes third level (xxx.wyrnz.com), but also fourth (yyy.xxx.wyrnz.com) and as many levels you want.
That also depends on you host. I know that some hosts restricts the number of sub-domains you're allowed to create.
If www.wyrnz.com is your domain you should not have to buy another domain. In fact, you can not even buy it, you already own it. about.wyrnz.com is a subdomain of wyrnz.com.
What I did is:
Create a subfolder on the webserver, create a subdomain and point the subdomain to that folder. Every time someone types in about.wyrnz.com, the index page in the subfolder will be served to the user

Use htaccess mod_rewrite to hide domain name

I've read lots about what can be done with mod_rewrite but I haven't found one to solve my problem. Maybe it can't be done?
I have a sub-domain on my primary domain that I have a customer direct user to to use one of my programs. The customer doesn't want his customers to see that that are on my domain and he doesn't want to use an iframe.
So, is it possible for the user to only see www.subdomain/program.php instead of www.subdomain.mydomain.com/program.php?
If you want the browser to show www.subdomain/program.php in its location bar, you need to register the www.subdomain domain name. There is no way to remove bits of the domain name using anything in the htaccess file. For example, if you've registered example.com and you have a server at foo.example.com, and you want to be able to go to http://foo/some/path/index.html, you're out of luck because the browser is going to attempt to do a DNS lookup of foo and it will most likely fail unless there happens to be a "foo" server under the DNS search domain. Browsers put a great deal of effort to prevent spoofing of the domain name, since it would be really bad if I was able to spoof my website to show the domain of a bank in a browser's location bar while actually visiting an entirely different website.

Universal list of domain endings?

Does anyone know where I could find a list of all publicly available domain endings? By "domain endings", I'm not necessarily referring to TLDs as I'm not interested in the .uk part of .co.uk since (AFAIK) individuals cannot register sites without having the .co preceding it.
If it helps to make things more concrete, here's my specific problem: given a domain name I want to return both the version of the domain preceded by www and the version not preceded by www. The input domain may or may not contain www.
The complication comes from the existence of domain names such as "www.com" or "www.info"; what I initially implemented would take www.info and return info and www.info.
I don't think you actually need to have a list of domain names:
given a domain name I want to return both the version of the domain preceded by www and the version not preceded by www
Pseudocode:
input name
does it begin with "www."?
if yes, strip out "www."
there's your domain name, save it
prepend "www." to domain name
save the result
lookup in DNS both the saved entries
if they exist, output them
You can get the list of current TLDs in many ways, slightly differently.
For example:
Going to IANA website at https://www.iana.org/domains/root/db (this is frequently updated after a new TLD got delegated in root zone)
Or just download the root zone file through the appropriate links: http://www.internic.net/domain/root.zone or ftp://rs.internic.net/domain/root.zone
You could also just query one of the current root nameservers that allow AXFR requests to just download the current root zonefile, such as dig #f.root-servers.net . AXFR with the added benefit that this is protected by DNSSEC (where the previous HTTP URL has no protection against tampering)
Of course this gives you only "Top Level Domains" not all "suffixes" under which a registry exists to allow the public (in general or part of it) to register domain names.
Having the list of those is currently still an unsolved problems, if you take into account the needs of automated process, freshness, decentralization of updates, etc.
The best solution is to use the Public Suffix List at https://publicsuffix.org/list/public_suffix_list.dat but first make sure to go to main site at https://publicsuffix.org/learn/ to learn in details about what it is, how to use it and its shortcomings.
You will find co.uk there.
But as for your:
in the .uk part of .co.uk since (AFAIK) individuals cannot register sites without having the .co preceding it.
This is not true anymore, showing that eligibility requirements in TLDs, or even structure, change over time. .UK is open to direct registrations now, see https://www.nominet.uk/domains/our-domains/uk-domains/
And also, side rant, when you work with domain names/TLDs please do not forget about IDNs, that could happen in any label in the DNS.

Where should a canonical domain name be enforced?

Our client would like to use just one domain name for their site to prevent diluting page rank in search engines.
For example, stackoverflow.com is the domain name they always use. If you type in www.stackoverflow.com you get redirected to the non-www version, as this is their choice for their domain name.
Where should this be done?
At the application server level (ex in IIS, set up a site and have it issue a permanent redirect to the proper domain name
At the application level
I don't like #1 as it means I have a bunch of extra sites set up just for redirecting. I don't like #2 as rewrite rules do affect performance.
thanks.
Do it at as low a level as you can possibly do it. Your application shouldn't know about its root domain name.

Resources