Click to See Complete Forum and Search --> : [RESOLVED] Sorry - don't know how to describe what I want to do!


MattStan
10-26-2006, 09:06 AM
Sorry, but I couldn't summarise what I'm trying to find out in the title!! :confused:

Basically, my question is this:

If I type www.webdeveloper.com/forum into my web browser, it delivers the relevant page.

However, on the site I'm trying to develop - a travel site - I have to type both the domain, the folder and then also the page before it delivers the relevant page.

For example, if I want to go straight to my cruise page, I have to type:
www.yourtravelcompany.co.uk/cruise/Introduction.htm rather than just having to type www.yourtravelcompany.co.uk/cruise which just delivers a 403 Forbidden message

Is this because of the way I have structured the site, or is it much, much more complicated than that?

Any advice would be great...

LeeU
10-26-2006, 09:46 AM
When you type the location to just the directory, the browser is looking for a default file, i.e., index.html (or whatever is set on your server). If it doesn't find it, it returns the error. It keeps your server from displaying a listing of all the files in that directory.

MattStan
10-26-2006, 10:23 AM
Oh I see - thanks. Is that why when you just type the domain name it automatically displays the home page which is called index.htm?

If this then is the case, in the "cruise" folder, can I name the page that I want them to fall on as Index rather than Introduction? Would this cause the page to be displayed if the folder is only entered in the adress?

LeeU
10-26-2006, 10:41 AM
Bingo! That's exactly what you need to do. (I'm not sure if it makes a difference but I would use all lowercase, i.e., index.htm as opposed to Index.htm)

MattStan
10-26-2006, 10:49 AM
Brilliant - Thanks a bunch - that's exactly what I shall do....

I'm not sure if it makes a difference but I would use all lowercase, i.e., index.htm as opposed to Index.htm

This opens another question that I've always been curious about...

If I type my URL as www.yourTRAVELcompany.co.uk or www.YOURtravelcompany.co.uk it always finds the site whether you type caps or not.

However, if you type yourtravelcompany.co.uk/Cruise/introduction.htm it will not find the page because the "C" in cruise is lowercase in my structure and the "I" of introduction is upper. Why does it not matter on the domain name, but it does for folders and pages?

scragar
10-26-2006, 10:53 AM
the bit http://www.mysite.com is irrelivent, it only returns an IP so case isn't important, but if your host uses Linux you'll find that file names and folder names are case sensitive.

Taschen
10-26-2006, 10:54 AM
It is possible to re-write URLs using an appropriate server configuration file. For example the file "cruises.html", stored in the sub-directory "/holidays_on_water/" would normally be accessed like this "http://www.mysite.co.uk/holidays_on_water/cruises.html" using a re-write directive it could be accessed like this "http://www.mysite.co.uk/ocean-cruise"

Whether you can do this or not will depend on the access your host gives you to the server. Also (following on from LeeU), it would be a good idea to understand more about directory structures and file priority first.

For an appache server try this;
1. In a plain text editor (notepad) place the following code, replace the text as appropriate:

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^cruises$ /directory/page_name.html

2. Save the file as ".htaccess" note that the point comes before htaccess and that there is no file extension.
3. Load .htaccess to the root web folder of your server. (The main directory of your web files).

To find out more about .htaccess http://httpd.apache.org/docs/1.3/howto/htaccess.html

MattStan
10-26-2006, 11:12 AM
Thanks Scragar - my host is Linux, so that answers that one - Thanks a lot

Hi Taschen - the .htaccess info is very interesting - thanks! My server is Apache (I believe) so I'll follow the link you provided and look into this in more depth. It looks a bit advanced for this newbie but I'll take a look anyway.

Thanks everyone!!