Forum Moderators: phranque

Message Too Old, No Replies

localhost .htaccess subdomain

         

cenotaph

9:42 pm on Feb 25, 2007 (gmt 0)

10+ Year Member



i have the same situation as stated in this topic -> [webmasterworld.com...]

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.

cenotaph

11:58 pm on Feb 25, 2007 (gmt 0)

10+ Year Member



sorry for opening a new topic, I have solved the problem with a DNS server.

SimpleDnsPlus for windows. I hope this helps for who is looking for this.
Thanks.

cenotaph

2:42 pm on Mar 3, 2007 (gmt 0)

10+ Year Member



This time when i try to upload my work to host.

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.

jdMorgan

2:53 pm on Mar 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, if you're getting "Server not Found" instead of "The requested URL cannot be found on this server," then it is most likely a DNS problem. Make sure you have an "A Record" that defines the subdomain (or defines wild-card subdomains) in your DNS zone file, and remember that it takes anywhere from 4 to 48 hours for DNS updates/changes to propagate through the DNS system.

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

cenotaph

12:26 pm on Mar 6, 2007 (gmt 0)

10+ Year Member



because i dont have an access to domain and DNS management on hosting i dont know whats going on. simply ask for my hosting to put

*.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.