Forum Moderators: phranque
such as simulating subdomains for query
the difference is i m working on my localhost under Windows and my local is divided to domains with VirtualHostByName.
My hosts file is:
127.0.0.1 www.fld.com
127.0.0.1 fld.com
127.0.0.1 fld
Everything is fine but when I try to access "subdomain.fld.com" of course system could not find dns record and looks up for UpperDNS.. result of page not found. So;
- Is there any way to enchance hosts file in a regex format?
- Do i need some extra DNS program / trick for this?
- Is this possible on localhost?
Thanks.
PS : My subdomain.example.com -> user.php?u=%1
everything fine but subdomain.example.com -> Server not found.
I have requested Server administrator to add ServerAlias *. to my configuration and here is the result.
<VirtualHost xx.xx.xx.xx>
ServerAlias exapmle.com *.example.com
ServerAdmin admin@example.com
DocumentRoot /home/example/public_html
BytesLog domlogs/example.net-bytes_log
User example
Group example
ServerName www.example.com
ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/User example
Group example
CustomLog /usr/local/apache/domlogs/example.net combined
</VirtualHost>
Still -> subdomain.example.com -> Server not found.
I m not that qualified in hosting management so i guess i m missing something about configuration or DNS part.
Thanks in advance.
The DNS zone file must map the (sub)domain to an IP address.
The host-provided server configuration file must map the subdomain to an 'account" -- the part of the filesystem assigned to your account.
Additional code in either the server configuration or in .htaccess files in your filespace may optionally be used to map subdomains to subdirectories.
All three must be in place before this will work.
Jim
*.example.com A DNS record points to example.com (as i did at local DNS server) and it all worked out.
thanks for this forum, its really hard to find experts in regex and rewriting.