dns
.htaccess rewrite subdomain to directory
Try putting this in your .htaccess file: RewriteEngine on RewriteCond %{HTTP_HOST} ^sub.domain.com RewriteRule ^(.*)$ /subdomains/sub/$1 [L,NC,QSA] For a more general rule (that works with any subdomain, not just sub) replace the last two lines with this: RewriteEngine on RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com RewriteRule ^(.*)$ subdomains/%1/$1 [L,NC,QSA]
Is it possible to have SSL certificate for IP address, not domain name? [closed]
According to this answer, it is possible, but rarely used. As for how to get it: I would tend to simply try and order one with the provider of your choice, and enter the IP address instead of a domain during the ordering process. However, running a site on an IP address to avoid the … Read more
Can I perform a DNS lookup (hostname to IP address) using client-side Javascript?
Edit: This question gave me an itch, so I put up a JSONP webservice on Google App Engine that returns the clients ip address. Usage: <script type=”application/javascript”> function getip(json){ alert(json.ip); // alerts the ip address } </script> <script type=”application/javascript” src=”http://jsonip.appspot.com/?callback=getip”> </script> Yay, no server proxies needed. Pure JS can’t. If you have a server script … Read more
How do browser cookie domains work?
Although there is the RFC 2965 (Set-Cookie2, had already obsoleted RFC 2109) that should define the cookie nowadays, most browsers don’t fully support that but just comply to the original specification by Netscape. There is a distinction between the Domain attribute value and the effective domain: the former is taken from the Set-Cookie header field … Read more
Create subdomains on the fly with .htaccess (PHP)
The quick rundown You need to create a wildcard domain on your DNS server *.website.com Then in your vhost container you will need to specify the wildcard as well *.website.com – This is done in the ServerAlias DOCs Then extract and verify the subdomain in PHP and display the appropriate data The long version 1. … Read more
Regular expression to match DNS hostname or IP Address?
You can use the following regular expressions separately or by combining them in a joint OR expression. ValidIpAddressRegex = “^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$”; ValidHostnameRegex = “^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$”; ValidIpAddressRegex matches valid IP addresses and ValidHostnameRegex valid host names. Depending on the language you use \ could have to be escaped with \. ValidHostnameRegex is valid as per RFC 1123. Originally, … Read more
how to use multiple IP’s in perl script
append the Proxy IP in user agent object. open(F,”IP.txt”); while(<F>) { my $ip=$_; $ua->proxy(‘http’, $ip); } close F;