Complicated DNS and hostname Setup Questions


#1

I want to setup my domain like this:

http://subdomain2.subdomain1.domain.com

example:

Obviously I have to control “search.com” but this is just an example.

I see how to make the first subdomain “subdomain1.domain.com” and am guessing to make “subdomain2.subdomain1.domain.com” is the same way.

The problem is that I want to do this via a script. For example I want to generate a list of every state and place that in a cut and paste field or even a script via the shell. It takes too long to click 50 time for each state and I plan on doing this for several different keywords.

Any ideas or suggestions?

Here are some things to keep the solutions more geared to what I actually need:

  1. Wildcard domains will not work. I need each subdomain2.subdomain1.domain.com to point to matching directories on the file server.

Example:

http://tx.bankruptcy.search.com needs to resolve to the files located on search.com server in this location:
/home/user/search.com/bankruptcy/tx/

wildcard makes everything point to the same directory, so everything would go to:
/home/user/search.com/ which is not what I want.

I realize that if someone hits: http://search.com/bankruptcy/tx/ it will show the files so I may need a solution to prevent that. (for now it doesn’t matter)

I’ve tried mod_rewrite but dreamhost said I had to figure it out on my own, and after several days of not understanding why I was getting 500 errors (I asked for the mod_rewrite log to see, but was told to figure it out on my own), I gave up.

This would be simple if I could use wildcards and then a script to redirect based on the domain and subdomain words. I just can’t figure that out.

So, is there a way to set this up via script or “all at once”?

  1. CGI parameters like : http://search.com?s1=bankruptcy&s2=tx will not work, that’s not the solution I want.

So if I can’t do a cgi parameter solution, mod_rewrite solution ( it uses .htaccess ), or a script to setup all at once, any suggestions on what I can do to get this structure setup without having to manually set each one up via the control panel?

Thank you in advance.


#2

You can complete tasks that are normally done through the panel via a script. However, the script must authenticate it self and submit the information to the panel. There is no other way to do such things with out going through the panel by some means. So you’d have to set your script up to log into the panel, and submit the informaitno you want, in the same manner as the stuff submits from the panel.

This has come up a few times before, you should be able to search the forums and find some of the other posts - though I don’t think there’s a lot of information on the subject. One or two of the topics have been about creating E-mails onthe fly for site users.

–Matttail
art.googlies.net - personal website


#3

Thank you. Any ideas or keywords I could look up? Not sure how the script would authenticate unless I used something like LWP and faked a browser session.


#4

update: I started to write a perl script using LWP, but quickly backed off that. THere are some automation scripts that are very easy to use. One is called Autoit, it’s free. I’m writing a script now that is working so far that uses the autoit engine. I’ll post a wiki link once it’s done. Thanks for the pointer.


#5

here’s one helpful post:
click here

I really thought there was an other, but I’m not finding it. Something about letting visitors create E-mail addresses through their site.

–Matttail
art.googlies.net - personal website