domain-name

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

感情迁移 提交于 2019-11-26 04:33:52
问题 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 see: [error] 13108#0: *1 directory index of \"/usr/share/nginx/mysite2.name/live/\" is forbidden . My sites-enabled config is: server { server_name www.mysite2.name; return 301 $scheme://mysite2.name$request_uri; } server { server_name mysite2.name

How to validate domain name in PHP?

泄露秘密 提交于 2019-11-26 02:57:04
问题 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 an alphanumeric character, then there may be more alnum characters plus also a hyphen. And it must end with an alnum character, too. If it\'s not possible, could you suggest me a regexp pattern to do this? EDIT: Why doesn\'t this work? Am I using

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

会有一股神秘感。 提交于 2019-11-25 23:49:20
问题 Firstly sorry for the 10,000th RegEx question, I realise there are other domain related questions but the regex is either not working properly, too complex, or for urls with subdomains, protocols, and filepaths. Mine is more simple, 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 dash (-) (e.g.