/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Sorry – don’t know how to describe what I want to do!

Sorry, but I couldn’t summarise what I’m trying to find out in the title!! ?

Basically, my question is this:

If I type [url]www.webdeveloper.com/forum[/url] 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:
[url]www.yourtravelcompany.co.uk/cruise/Introduction.htm[/url] rather than just having to type [url]www.yourtravelcompany.co.uk/cruise[/url] 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…

to post a comment
Full-stack Developer

7 Comments(s)

Copy linkTweet thisAlerts:
@LeeUOct 26.2006 — 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.
Copy linkTweet thisAlerts:
@MattStanauthorOct 26.2006 — 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?
Copy linkTweet thisAlerts:
@LeeUOct 26.2006 — 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)
Copy linkTweet thisAlerts:
@MattStanauthorOct 26.2006 — 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[/QUOTE]

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?
Copy linkTweet thisAlerts:
@scragarOct 26.2006 — 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.
Copy linkTweet thisAlerts:
@TaschenOct 26.2006 — 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:
[CODE]
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^cruises$ /directory/page_name.html
[/CODE]

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 [URL=http://httpd.apache.org/docs/1.3/howto/htaccess.html]http://httpd.apache.org/docs/1.3/howto/htaccess.html[/URL]
Copy linkTweet thisAlerts:
@MattStanauthorOct 26.2006 — 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!!
×

Success!

Help @MattStan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...