Questions tagged [domain-name]

A domain name is a string of characters that identifies a realm of authority within a Domain Naming System (DNS).

A domain name is a string of characters that identifies a realm of authority within a Domain Naming System (DNS). They serve as human-friendly pointers to IP addresses and other resources that host various services like HTTP/HTTPS, SMTP, IMAP, SIP, etc. Domain names can be (and are) used on private networks, but they are an integral component of the modern Internet.

510 questions
486
votes
19 answers

Get The Current Domain Name With Javascript (Not the path, etc.)

I plan on buying two domain names for the same site. Depending on which domain is used I plan on providing slightly different data on the page. Is there a way for me to detect the actual domain name that the page is loading from so that I know…
Freesnöw
  • 30,619
  • 30
  • 89
  • 138
289
votes
21 answers

Nginx 403 error: directory index of [folder] is forbidden

I have 3 domain names and am trying to host all 3 sites on one server (a Digital Ocean droplet) using Nginx. mysite1.name mysite2.name mysite3.name Only 1 of them works. The other two result in 403 errors (in the same way). In my nginx error log, I…
Ryan
  • 22,332
  • 31
  • 176
  • 357
219
votes
2 answers

Linux command to translate domain name to IP

Is there any Linux command to translate a domain name to an IP address?
Frank
  • 7,235
  • 9
  • 46
  • 56
167
votes
22 answers

What is a regular expression which will match a valid domain name without a subdomain?

I need to validate a domain name: google.com stackoverflow.com So a domain in its rawest form - not even a subdomain like www. Characters should only be a-z | A-Z | 0-9 and period(.) and dash(-) The domain name part should not start or end with…
Dominic
  • 62,658
  • 20
  • 139
  • 163
104
votes
11 answers

What's the best method in ASP.NET to obtain the current domain?

I am wondering what the best way to obtain the current domain is in ASP.NET? For instance: http://www.domainname.com/subdir/ should yield http://www.domainname.com http://www.sub.domainname.com/subdir/ should yield http://sub.domainname.com As a…
Matt Mitchell
  • 40,943
  • 35
  • 118
  • 185
89
votes
14 answers

WWW or not WWW, what to choose as primary site name?

From technical perspective the only issue is traffic and incoming links (one of them should redirect to another). Now I need to choose which one should be primary. Some sites have www (google, microsoft, ruby-lang) and some without www…
Mike Chaliy
  • 25,801
  • 18
  • 67
  • 105
86
votes
2 answers

PHP get domain name

I want to get the domain name for where the script is running. How can that be done with PHP? I see that $_SERVER['HTTP_HOST'] as well as $_SERVER['SERVER_NAME'] contain this information. Will that variable always work and should I use one over the…
Francisc
  • 77,430
  • 63
  • 180
  • 276
78
votes
3 answers

How to obtain Domain name via JavaScript?

Is there a way to obtain the domain name of the current page by using javascript in a browser (IE, FireFox, etc) ?
Ashutosh Nasikkar
69
votes
8 answers

Are email addresses allowed to contain non-alphanumeric characters?

I'm building a website using Django. The website could have a significant number of users from non-English speaking countries. I just want to know if there are any technical restrictions on what types of characters an email address could…
Continuation
  • 12,722
  • 20
  • 82
  • 106
66
votes
16 answers

How to get page URL or hostname in NextJs Project?

I want to get the page's full URL or site hostname like the image below on Static Site Generator. I will try with window.location.hostname, but it doesn't work. The error: window not defined.
Raju Ahammad
  • 873
  • 2
  • 9
  • 15
58
votes
4 answers

Get domain name from an email address

I have an email address xyz@yahoo.com I want to get the domain name from the email address. Can I achieve this with Regex?
user339160
41
votes
20 answers

How to validate domain name in PHP?

Is it possible without using regular expression? For example, I want to check that a string is a valid domain: domain-name abcd example Are valid domains. These are invalid of course: domaia@name ab$%cd And so on. So basically it should start with…
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
39
votes
4 answers

How to use naked GoDaddy domain with OpenShift hosting?

Desired Behaviour I have a GoDaddy domain name and am using OpenShift for hosting. I would like the following to be true: a) user enters www.mysitename.com > user sees mysitename.com b) user enters www.mysitename.com/about.html > user sees…
user1063287
  • 10,265
  • 25
  • 122
  • 218
38
votes
18 answers

Get domain name (not subdomain) in php

I have a URL which can be any of the following…
Cyclone
  • 17,939
  • 45
  • 124
  • 193
37
votes
6 answers

Using Domain name instead of localhost in with https in xampp

My question may be stupid, But honestly I searched a lot and got success but not complete. I use xampp with windows 8. My host file looks as follows. 127.0.0.1 localhost 127.0.0.1 www.mysite.com My httpd-vhosts.config looks as follows. …
Jeet Chaudhari
  • 760
  • 1
  • 8
  • 14
1
2 3
33 34