FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 02-24-2009, 01:46 PM   Postid: 172988
awslawson
Registered User

Forum Notability:
0 pts: Even-handed
[Post Feedback]
 
Join Date: Feb 2009
Posts: 2
Handling URL mis-spellings

I have a page at

http://www.yankgulchmusic.com/products.html

which works fine. Now I'd like to send users to that same page if they type

http://www.yankgulchmusic.com/Products

Using TelNet I've created soft links to send users from one directory to another, but always with names that include the .html extension. For example, while in my home directory I did:

ln -s ./DETAILSFILES/UnsungSongsDetails.html ./UnsungSongsDetails.html

This permits users who type

http://www.yankgulchmusic.com/UnsungSongsDetails.html

to be directed to the page at

http://www.yankgulchmusic.com/DETAIL...gsDetails.html

This doesn't work without the .html extension. Following a suggestion from the FutureQuest desk I created a directory out of the URL name without the extension and went on from there to get at least a partially OK result.

Is there some other way to accomplish what I want to do without using soft links?
awslawson is offline   Reply With Quote
Old 02-24-2009, 02:10 PM   Postid: 172989
johnfl68
Site Owner
 
johnfl68's Avatar

Forum Notability:
975 pts: Dignified Competence!
[Post Feedback]
 
Join Date: Nov 2003
Location: Orlando, FL
Posts: 1,018
Re: Handling URL mis-spellings

I think you can do this with a redirect in your .htaccess file. I have never tried to go from a folder to a file, but the second one should work fine.

Redirect
is the redirect
301 states that the file is moved permanently
/old.htm is the file that people entered (do not use the full address for this)
http://www.mysite.com/new.html is the page you want people to go to (must use full address)

Something like this perhaps:
Code:
Redirect 301 /Products http://www.yankgulchmusic.com/products.html
Redirect 301 /UnsungSongsDetails.html http://www.yankgulchmusic.com/DETAILSFILES/UnsungSongsDetails.html
If you google search "htaccess redirect" there are many sites on this. There are several ways to do things, depending on what you are trying to do.

Be careful using htaccess, as you can case problems very easily.

John
__________________
Major Warden: Yes, there's always the unexpected, isn't there?
The Bridge on the River Kwai (1957)
johnfl68 is offline   Reply With Quote
Old 02-24-2009, 02:32 PM   Postid: 172991
 Kevin
Systems Administrator
 
Kevin's Avatar
 
Join Date: Aug 2001
Location: Orlando, FL
Posts: 2,481
Re: Handling URL mis-spellings

The biggest problem you will encounter with symlinking a file.html to directory/index.html is that any relative URLs within the html file to things like images will be wrong. IOW, if within that html file there is a reference to images/image.jpg that would be ../images/image.jpg from within the sub directory.

You can fix that by either using all absolute URLs within the HTML file or by making even more symbolic links. Or you can use a rewrite instead of symbolic links.
__________________
Kevin
Kevin is offline   Reply With Quote
Old 02-25-2009, 11:14 AM   Postid: 173002
awslawson
Registered User

Forum Notability:
0 pts: Even-handed
[Post Feedback]
 
Join Date: Feb 2009
Posts: 2
Re: Handling URL mis-spellings

Hi Kevin,

What do you think about the suggestion by johnfl68 to use .htaccess to Redirect the offending URL address?

awslawson
awslawson is offline   Reply With Quote
Old 02-25-2009, 11:23 AM   Postid: 173003
 Kevin
Systems Administrator
 
Kevin's Avatar
 
Join Date: Aug 2001
Location: Orlando, FL
Posts: 2,481
Re: Handling URL mis-spellings

A Redirect is a perfectly valid way to handle the problem. So is a ReWrite though they are easier to screw up.
__________________
Kevin
Kevin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:26 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.