Forum Moderators: phranque
Unfortunately, adding domain names is costly with Windows-based hosting! I looked around, but the best plans to allow multiple domain names all use Linux.
Also, I have .htaccess envy. ;-)
Is there a way to set up the domains on a Linux server and tell it to load the page content from an ASP page on a different server, e.g. with a PHP script?
Or, does anyone know of a good Windows-based webhost that allows 10+ domain names on an account without high surcharges or set-up costs?
Thanks.
You could frame the pages, scrap the pages, or have the content output to a file and read that in. Also, there are some packages that allow ASP to be run on Linux (Apache:ASP, iASp, Chilisoft). I don't know how well any of them do, but you might want to check whether any host offers them and see if they work okay.
>> a way to set up the domains on a Linux server and tell it to load the page content from an ASP page on a different server
There is such a way - in fact, as soon as you get out of that Microsoft environment, you will find that There's Always More Than One Way To Do It. You need to get a mod_rewrite enabled server, then you can have any cake and eat it too.
This is a link to R Engelschall: A Users Guide to URL Rewriting with the Apache Webserver [engelschall.com] - popularly known as Engelschalls rewrite guide. You will probably not understand this whole document, even after a few years, but it mentions everything you will ever want to know. Except perhaps, the cake. The particular solution you are looking for is mentioned there as well. What you want to do is basically to "mirror" those other pages of yours.
<cut>
This post was a bit longer, but i decided not to be too explicit in this case.
/claus
thanks for the link. "Dynamic mirroring" is what I need, right?
A few questions (obviously, I'm a newbie to the Apache world)...
1. The rewrite rule goes into .htaccess, right?
2. I looked up a few more documents on mod_rewrite. One mentioned editing the httpd.conf file. I assume I don't have to do that if the server is already mod_rewrite enabled... right?
3. Does the server have to be restarted after changing rewrite rules?
4. Do the pages get served as "200 OK"?
5. If I have the same file structure between those two servers and just want to mirror 1:1 from one domain to the other (possibly with a different file extension than .asp), then .htaccess should be just a few lines, and what I'm trying to do is really not THAT complicated... right? Any other potential pitfalls?
Just trying to get up my courage here... ;-)
Johanna
Always More Than One Way To Do It
Here's some more ways using just php:
include("http://www.other-domain.com/page.asp") [edited by: jamesa at 11:25 pm (utc) on Oct. 11, 2003]
httpd.conf is the main configuration for your "http daemon", that is, your server configuration file. You will have to pay extra to get access to this as it will normally imply not only hosting, but a virtual or dedicated server just for you. Changes to this file requires a server restart. You will probably not need (any of) that. .htaccess is the file you will need to use for your RewriteConditions. For the conditions to work, the Apache module mod_rewrite must be enabled. You don't need to restart the server after making changes in a .htaccess file, it will work instantly after you upload the file to the server. "Dynamic Mirroring" will require one
RewriteCondition in your .htaccess file (one line). Depending on server setup (as specified in httpd.conf), you might need to enable symbolic links and to turn on the rewrite engine as well, that's two extra lines. It will work instantly, and mirror the files "1:1" including the ".asp" extension. You don't need to bother about the extension as the files will not be on your server, they will run on the windows server, and be shown on yours (as well as the other). You will probably need to use relative links on your windows website, but i'm not sure, as "There's Always More Than One Way To Do It". Pages will most likely get returned with a "
200 OK" or a "20X Found" (i don't recall what X is right now, possibly 1 or 3, i guess 3) - then again, if your windows server goes down, it will give 404's on your linux/apache as well. Basically, Apache is much like LEGO bricks, in the sense that there are a lot of "mod_whatever" (modules) for it, that can carry out all sorts of tasks. At modules.apache.org [modules.apache.org], currently 278 modules are listed, and i know only a fraction of them.
As you know ASP, the module
Apache:ASP that BlueSky mentioned would be a good choice, but this is not usually part of a standard hosting package as far as i know. In stead of listing modules, i'll just say that a standard linux/apache hosting package will normally have all the necessary modules, and then some. To play safe, you could ask the potential host if they will install an additional module for you if it's not found on the server already. >> My pages are built in ASP, and I want to run the same code under several different domain names.
As usual, "There's Always More Than One Way To Do It". Now, if i was most comfortable with ASP, and this was my problem, i would not switch to a linux/apache environment just because of this. The roadmap above is far too complicated, although it might sound simple.
What i would do in stead was:
(a) Get a (one) fixed IP for my ASP pages
(b) Point all my gazillions of domains to that IP, using DNS (a control panel, dedicated DNS service, registrar, or whatever)
- two steps, problem solved. It might not cure the .htacess envy though ;)
/claus
Things are beginning to take shape in my head.
About your last suggestion. Hmmm maybe I'm missing something, but so far, when I added a new domain, I:
- registered the domain name with godaddy
- pointed the nameserver to that of my hosting company
- had my webhost add the domain name to my account, for which they charged me a setup fee.
So you're saying there is another way to do it? Do I need to add a middleman between godaddy and my host? What kind of company would do this?
I do have a dedicated IP with the webhost. Maybe the nameserver should be elsewhere - not with my webhost?
Johanna
-------------------------------
(a) Get a (one) dedicated IP for my ASP pages
-------------------------------
- i wrote "fixed" and that's wrong. Dedicated is the right word.
Yes. In your case it might also be the best and easiest. Due to the nature of this forum, i also have to say:
The method below is definitely not for everyone.
It's relevant in this case, as a lot of domains and different types of technology is involved, but my best guess is that more than 95% of the readers of this forum will do just as good without it. That is - don't follow this path unless you really need it.
If you need it, you will simply know that you need it, as in "your business will not do without it" - it's not just something that's "nice to have". It's necessary for some, for others it's just not necessary at all, like, totally irrelevant and a waste of time and money. If you're not absolutely certain that you are on the "relevant" side (and you will know this) then it's simply not relevant to you.
And: Doing it this way offers no Search Engine benefits compared to other ways of acheiving the same effects. It's just good advice for this specific case, nothing else, and you do need a specific case for this to be good advice.
>> Do I need to add a middleman between godaddy and my host?
Now, godaddy is a specific company, it's not one i have used for domains sofar, but i guess it can register domains like any other registrar; it might even be good, i really don't know. Let's take the general case in stead:
(a) You have disk space for your pages, scripts, images, etc. Also a web server serving those. That would be your host.
(b) You have a (dedicated) IP address for that web server. If you share IP with others, this will not work. In both cases, your host will configure things so that this IP will point to your web server/disk space (on a shared IP your domain name is required as well as the IP, that's the "setup" costs).
(c) You have some amount of domain names, purchased somewhere.
The main reason why you would even have (c) when you also have (b) is that it's much easier for people to remember, say, "example.com" than it is to remember "127.0.0.0". The IP address alone should serve up your web site, and it most likely does - otherwise you are on a shared IP and not a dedicated one.
Secondary reasons are, eg. branding value of some word, plus the fact that multiple domains can point to one IP address so you can run more than one website off the same server. So, get a dedicated IP for your disk space. Then point your domains to that IP - that way you will have created all the duplicate sites you need in just two easy steps (and in fact you will operate your own shared IP).
With a dedicated IP your web host will only need to "host" your pages and your webserver, and connect those to that IP. This is their job. Domains are - strictly speaking - not their business, although not that many of them are willing to admit it. Purchase of "IP only" hosting is not available at all hosts, most would like to possess your domain names as well, to some degree. This implies that if you should decide to shift host, you need to transfer your domain(s) also, which is something that makes this process a bit more complicated than it needs to be.
>> What kind of company would do this?
It's not really important who runs the nameservers for this domain - all nameservers can point all domains to all IP's (in principle at least). I don't know if godaddy can do this. Some registrars provide a control panel or other methods that will enable you to do it. If godaddy can, and you're satisfied with their service, then there's no need to find another company.
Otherwise you will need to look for a decent DNS hosting company. There are several of them on the market. These firms do not provide disk space, nor do they provide a webserver. They only provide nameservers, that allows domain names to be pointed at IP addresses (and a bit more, but that's not for this thread).
You will need to transfer the domain names to the DNS provider, but this is a one-time exercise. If you decide to shift host for any or all of your webpages, just get a new host and a new ip, and make the changes at your DNS provider. No need to transfer domains between web hosts.
/claus
Interesting.
Weighing the pro's and con's:
pro: easy to change hosts later on; better performance than passing each page through two hosts; cheaper (especially if I do change hosts)
con: NOT cheaper if I stick with my webhost (because DNS hosting is a recurring fee vs. a one-time setup fee); I'd still have the therapy bills from .htaccess envy ;-)
I think I'll try both options. To save money, I feel it's good to branch out into the Linux world, but for this very specific case, DNS hosting is probably the more suitable choice.
Johanna
P.S.: Godaddy (my registrar) does offer "full DNS control" however, only if I also use their hosting.