Simple html linking question (or browser issue, don't know)

  • Tojiro
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jan 10, 2006
  • Posts: 9
  • Status: Offline

Post January 10th, 2006, 11:28 am

I assume this is something simple that I just don't know about, but I'm making a site, and I want to be able to link to pages so that the browser's address bar says:

www.site.com/link <-- good

and NOT www.site.com/link.html <-- bad

Is there a way to do this? (using relative link locations)

I was under the impression (not sure why, though) that if you just linked to the folder name, it would load the page that was in the folder (index.html) automatically. Anyway, that doesn't seem to be working. I'm in Dreamweaver MX on an imac, but I want this to be compatible for everything + everybody

I tried naming a page 'dojoinfo' (no extension) and linked to that. so the address was "www.site.com/dojoinfo" That worked in IE and Safari, but not FF.

Maybe it's just a browser issue then if that's the only way to do it.... I don't know. Really could use some help. THanks

Edit: This isn't my home computer, so it's FF 1.0.2, would that be the issue? would it work on 1.5? At the moment, FF wants to dowload the 'dojoinfo' text file... =\
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 10th, 2006, 11:28 am

  • onlyican.com
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Nov 20, 2005
  • Posts: 1582
  • Loc: Hants, UK
  • Status: Offline

Post January 10th, 2006, 12:01 pm

For it to display link, it is a folder

http://site.com/link/index.php

strip the index

http://site.com/link
Heal your mind, and the body will follow
  • PsyckBoy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jun 20, 2005
  • Posts: 204
  • Loc: SoCal
  • Status: Offline

Post January 10th, 2006, 12:41 pm

You need to find out what the default file name your webserver is configured to look for if no file is given in the URL. Generally, index.html is the standard, but some webservers don't include this by default (Microsoft's IIS comes to mind).

For example, given the following URL:

http://www.site.com/link

and assuming that "link" is a folder in the root web folder, your webserver will look for certain files in "link" to display by default. Your webserver is apparently looking for something other than "index.html".

I don't recommend relying on browser quirks, a la your dojoinfo example. Things like that will tend to bite you in the ass down the road.
  • Tojiro
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jan 10, 2006
  • Posts: 9
  • Status: Offline

Post January 10th, 2006, 2:59 pm

Ahh, server stuff. well then. I'll have to talk to whoever knows the guy with server space.

Thanks so much! :D
  • Vincent
  • Expert
  • Expert
  • User avatar
  • Joined: Dec 01, 2005
  • Posts: 722
  • Loc: Brisbane, Australia
  • Status: Offline

Post January 10th, 2006, 3:02 pm

you could put something like this into a .htaccess file
Code: [ Download ] [ Select ]
Alias /link "C:/Program Files/apache/htdocs/link.html"

because when you go to http://www.site.com/link, it will probably go to http://www.site.com/link/index.html instead of http://www.site.com/index.html
  • PsyckBoy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jun 20, 2005
  • Posts: 204
  • Loc: SoCal
  • Status: Offline

Post January 10th, 2006, 3:57 pm

The Alias directive can't be used in an .htaccess file (according to Apache's website anyway).
  • mrmagu
  • Student
  • Student
  • No Avatar
  • Joined: Dec 14, 2004
  • Posts: 86
  • Loc: Great White North
  • Status: Offline

Post January 11th, 2006, 5:44 am

lalala heres an old .htaccess of mine.. (snippet)..

Code: [ Download ] [ Select ]
DirectoryIndex index
<Files index> 
ForceType application/x-httpd-php
</Files>
<Files about-cmf>
ForceType application/x-httpd-php
</Files>
<Files company-profile>
ForceType application/x-httpd-php
</Files>
  1. DirectoryIndex index
  2. <Files index> 
  3. ForceType application/x-httpd-php
  4. </Files>
  5. <Files about-cmf>
  6. ForceType application/x-httpd-php
  7. </Files>
  8. <Files company-profile>
  9. ForceType application/x-httpd-php
  10. </Files>


I'm not sure if you can do multi Files in one, if so, someone post that..

hope that helps
  • PsyckBoy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Jun 20, 2005
  • Posts: 204
  • Loc: SoCal
  • Status: Offline

Post January 11th, 2006, 12:23 pm

This all assumes that the server being used is Apache.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 307 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.