|
Discussion Forums
|
Thread: Virtual Hosting / Root Key
 |
This question is not answered.
Helpful answers available: 1.
Correct answers available: 1.
|
|
|
Posts:
26
Registered:
3/24/06
|
|
|
|
Virtual Hosting / Root Key
Posted:
Jun 14, 2006 10:27 PM PDT
|
|
|
Is there any way to specify a root key/document with the new virtual hosting feature?
For example, when a user types in a domain aliased to a bucket
http://www.mydomain.com, that it automatically pulls up
http://www.mydomain.com/index.html or some other specified key?
|
|
Posts:
73
Registered:
4/10/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 15, 2006 8:43 AM PDT
in response to: toastab
|
|
|
Is this possible? I didn't see any mention in the new vhost documentation.
|
|
Posts:
26
Registered:
3/24/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 15, 2006 9:10 PM PDT
in response to: toastab
|
|
|
Don't know, that's what I'm trying to find out.
If it's not possible, then whenever anyone typed a domain name in the browser w/out a specific key, it would return nothing.
|
|
Posts:
114
Registered:
2/10/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 15, 2006 10:32 PM PDT
in response to: toastab
|
 |
Helpful |
|
|
Hi Toastab,
No, there is no way to do this. In your example, if you were to do a GET on just
http://www.mydomain.com/, then Amazon S3 would interpret this an anonymous request to list the keys in the bucket "www.mydomain.com". The result would either be an access denied error or an xml document containing a list of keys.
thanks,
dave
|
|
Posts:
26
Registered:
3/24/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 12:02 AM PDT
in response to: Dave Barth
|
|
|
Any chance that something like this would be added?
For example, having S3 check for a key named "default" first to serve up if no key is specified (before returning the traditional not found)?
This would be extremely useful for anyone hosting static content off S3 and using a CNAME to alias the host to a bucket.
|
|
Posts:
114
Registered:
2/10/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 12:45 AM PDT
in response to: toastab
|
|
|
Unlikely that we would do this without substantial clamoring from customers. As far as I can tell, it would require a non-backward compatible change to the LIST API and we avoid those sorts of changes whenever possible.
-dave
|
|
Posts:
129
Registered:
3/27/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 5:59 AM PDT
in response to: Dave Barth
|
|
|
Pity, not having the ability to have a default root/index page would appear to break one of the 'major rules' of end-user web usability (even more of 'sin' than breaking the back button !). I'm not a DNS expert, is there a CNAME work around to this ? How about an option to style XML responses via "<?xml-stylesheet type="text/css" href="nice and pretty"?>" ?
Tom
|
|
Posts:
26
Registered:
3/24/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 7:05 AM PDT
in response to: toastab
|
|
|
I don't presume to understand all the technical aspects of S3, but couldn't backward compatibility be maintained if the "default" key was something that it was extremely unlikely / impossible for anyone to have used, aka:
GET on
http://my.domain.com if (__aws__s3__defaultkey exists) return it
else return access denied or xml list
S3 is just begging to be used as a full-on website repository/host, and the vhost feature makes everything (except the root document) possible.
Our clients (and I imagine other apps like S3 wiki) would be able to use S3 as our entire hosting backend (not just a place where secondary content/media is stored), and only have to use our servers for pre-processing, apps, etc.
Here's the sound of one company clamoring!
|
|
Posts:
47
Registered:
5/26/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 7:22 AM PDT
in response to: toastab
|
|
|
Could you not just get away with a redirect to the default doc..
All im doing is setting my cname & bucket on: mydomain.com
and www.mydomain.com as a redirect to mydomain.com/index.htm
Not the best way, but it works & it shouldnt worry search engines.
|
|
Posts:
129
Registered:
3/27/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 7:26 AM PDT
in response to: toastab
|
|
|
I wish to add my cross-atlantic clamouring to all the states-side clamoring.
|
|
Posts:
26
Registered:
3/24/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 8:04 AM PDT
in response to: acorcutt
|
|
|
acorcutt
That's an intersting idea, but wouldn't that only work properly if the user typed in the full
www.mydomain.com
and would fail and display the Access Denied/or Listing when the user types in just mydomain.com?
|
|
Posts:
73
Registered:
4/10/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 8:19 AM PDT
in response to: toastab
|
|
|
*clamor*
Could the http request headers be used for this? (to disambiguate browser gets and "list the bucket" gets)
|
|
Posts:
26
Registered:
3/24/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 8:39 AM PDT
in response to: toastab
|
|
|
FYI, we outsource to dnsmadeeasy, which lets us control pretty much any aspect of the records, and none of my experiments with acorcutt's idea has achieved 100% success yet.
=======================
TEST #1
CNAME mydomain.com to S3
REDIRECT
www.mydomain.com
to mydomain.com/default.html
Won't work. Can't CNAME the root. An A record would work, but that requires an IP address which would lose the benefit of bouncing around to all of S3s servers, and it would still get screwed up when they don't type www.
=======================
TEST #2
CNAME
www.mydomain.com
to S3
REDIRECT mydomain.com to
www.mydomain.com/default.html
Works if user types in mydomain.com, but
www.mydomain.com
only returns the S3 access denied/listing, not default.html
=======================
TEST #3
CNAME www2.mydomain.com to S3
REDIRECT mydomain.com to www2.mydomain.com/default.html
REDIRECT
www.mydomain.com
to www2.mydomain.com/default.html
Works, sort of. Both root and www. work, but now we're dealing with a new www2 subdomain, and the whole problem begins again.
|
|
Posts:
47
Registered:
5/26/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 8:54 AM PDT
in response to: John Spurlock
|
|
|
Yes, it would still list the buckets if you go direct to the url you have the cname on.. I actually have my bucket setup on static.mydomain.com, so the mydomain.com & www.mydomain.com get forwarded to static.mydomain.com/index.htm (this covers the 2 most likey entry points from a users point)
But, still if they enter static.mydomain.com they get the access denied.
john,
Not sure how you can use the http headers without putting the request through your own servers - maybe you could do something like this if you have your own dns servers. My dns is only on enom, so all ive got is the standard cname & forwarding options.
|
|
Posts:
47
Registered:
5/26/06
|
|
|
|
Re: Virtual Hosting / Root Key
Posted:
Jun 16, 2006 9:16 AM PDT
in response to: toastab
|
|
|
toastab,
I dont have this in enom but dnsmadeeasy looks like you can set up http redirects for any path..
http://www.dnsmadeeasy.com/s0306/prod/redir.html
Could you not setup a cname on www.yourdomain.com, and also a http redirect on www.yourdomain.com/ to www.yourdomain.com/index.htm or something?
|
|
|
|