Boojum Posted November 24, 2003 Share Posted November 24, 2003 I'm in the process of redesigning my site to incorporate six subdomains, arranged by topic, and understand that the "home page" for each subdomain should be called "subdomain.mysite.com/index.html" or ".../default.html". The trouble is, if I name them that way, they need to be placed in separate subfolders within my (local machine) Web Pages folder, and would therefore be listed (on my machine) as "mysite.com/subdomain/index.html" or ".../default.html", which I believe would lead to confusion in finding them online. A workaround is to name the document, e.g.: "subdomain.mysite.com/subdomain-index.html", but this seems clumsy and verbose. Needless to say, I'm still fairly new to this. Anyone know how to cut this particular Gordian knot? Quote Link to comment Share on other sites More sharing options...
Lianna Posted November 24, 2003 Share Posted November 24, 2003 I'm in the process of redesigning my site to incorporate six subdomains, arranged by topic, and understand that the "home page" for each subdomain should be called "subdomain.mysite.com/index.html" or ".../default.html". The trouble is, if I name them that way, they need to be placed in separate subfolders within my (local machine) Web Pages folder, and would therefore be listed (on my machine) as "mysite.com/subdomain/index.html" or ".../default.html", which I believe would lead to confusion in finding them online. A workaround is to name the document, e.g.: "subdomain.mysite.com/subdomain-index.html", but this seems clumsy and verbose. Needless to say, I'm still fairly new to this. Anyone know how to cut this particular Gordian knot? A subdomain is just simply a slick way of calling another page. Usually, that other page is located in a subdirectory of the site's home. Usually that subdirectory has the same name as that of the subdomain. However, you can redirect a subdomain to whatever page you like, named whatever you like it to be named. Honestly, the most simplistic way to do this is create the subdirectory for each subdomain and call each sub's home page index.html. When you create a subdomain through cPanel, it automatically makes the corresponding subdirectory in your public_html folder and it's ready to receive its very own home page and additional pages. Analogy (good bad or indifferent.) At a doctor's office they have a file drawer with multiple folders in it, one per patient. Each patient's folder has a health history record and a personal info sheet among other things. Each folder has a label on it so that it can be found easily and identify the contents. Your subdomains are the same thing. Your site is the drawer. Your subdomains are each folders in the drawer. The subdomain name is the label. The health record is the index.html page and the other pages accordingly. Hope I've helped rather than confused. Quote Link to comment Share on other sites More sharing options...
Boojum Posted November 25, 2003 Author Share Posted November 25, 2003 Lianna, I was afraid I might not have made my question clear. The problem I'm finding is with making the server (1) correspond with my computer (2) and vice versa. Let's assume I create a homepage for my server-side(1) Santa Cruz subdirectory and call it "santacruz.squort.com/index.html". That is easy; I have only to upload an "index.html" page into my "santacruz" subdomain directory and refer to it as above within all hypertext references, and it should be found when people type it into their browsers or click a link to it. But: On my own computer(2), that page needs to go into a subdirectory within my Web Pages directory. And, if I then click on a button linking to the page (listed as "santacruz.squort.com/index.html"), my browser will not find the page. How can I classify/place this subdomain index page in my Web Pages folder so that it can be found both via the internet once uploaded and via Local Machine Zone when I want to look at the page offline in Internet Explorer and its ilk? (I have already found that putting an "index.html" page into a "santacruz" folder within my Web Pages folder does not work; the hypertext reference that finds such a page is not "santacruz.squort.com/index.html" but "squort.com/santacruz/index.html", which in turn will not find that page in the subdomain folder online. Am I making the problem at all clear?) Please help me work this out; this problem is delaying my site upgrade. Quote Link to comment Share on other sites More sharing options...
Madmanmcp Posted November 25, 2003 Share Posted November 25, 2003 Hi Boojum, the way the web works is by givng specific directions (to a browser) to locate the pages or pieces of information to place on your pages. Normally these "directions" are for locations on the Internet so that anyone can find them. These are in the form of domain name with folders/files under these domain names, ie. santacruz.squort.com/index.html. Now a browser will also work "offline" and display your web pages if you use "generic" directions to the pages and files within your html code. The more specific you are in your code the more limited you will be in what you see offline. What I mean by this is to not always use the full path to your images and pages in your coding, once your in the domain (or location) of your files this will become the default location and will not need to be used again. The way to navigate around the harddrive is by using the "path" or folders/subfolders/filename route which is slightly different then the navigation around the internet which is your problem here. Your html code specifies the domain name and offline everything is in a folder and these do not match which is the cause of your confusion. So the trick is to not code the domain name each and everytime, it should be the assumed default starting point. Make sure that the folders, subfolders and files names are all named the same on both ends and things should work fine online or offline. When you see santacruz.squort.com/index.html, change it to just index.html. The santacruz.squort.com/index.html is directing you out onto the internet and if you are not connected to the internet will give you an error oir will not display. Using just plain index.html will look for that file in your current (default) location. If you are on the page it will pull that file from the server, if you are offline it will pull from the current folder on the hard drive. BoB/Madman Quote Link to comment Share on other sites More sharing options...
Boojum Posted November 25, 2003 Author Share Posted November 25, 2003 Madman, Thanks for responding, and I see your point in the general case. But here's a specific issue: Atop each page, I am installing six tabs for navigation among the subdomains, and the hypertext reference for each is in the format, e.g., "santacruz.squort.com/index.html", while the homepage tab is referenced by "index.html" alone. If I follow your advice as I understand it, referencing each page only with "index.html", the browser will presumably open the same page (the main index page) each time a tab is pressed. My problem, then: How to write the hypertext references for these tabs so they will open, respectively, "index.html", "santacruz.squort.com/index.html" and the other four pages as intended when pressed--whether on the internet or offline. Quote Link to comment Share on other sites More sharing options...
Boojum Posted November 25, 2003 Author Share Posted November 25, 2003 Hmmm... I wonder: Would it be well for me, on my hard drive, to rename my overall "Web Pages" folder "squort.com" and then create five separate folders (rather than five subfolders within "Web Pages"), titled "santacruz.squort.com", et cetera? Quote Link to comment Share on other sites More sharing options...
Boojum Posted November 25, 2003 Author Share Posted November 25, 2003 Ah. I begin to see. Offline browsing does read correctly from subfolders within "Web Pages" after all; I just have to name the subfolders correctly, and omit further specifications. My apologies for any wasted effort involved in replying to the self-answering question. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.