Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 04-14-2005, 12:00   #1 (permalink)
Ignoramus21798
Civilians

 
Default javascript redirect: make filename from query

I currently have a dictionary.

A user enters a word (say, desk) in the "word" box and gets to

http://www.cooldictionary.com/index.mpl?word=desk

I want to change them and get them to

http://www.cooldictionary.com/word.desk.html

I already have mod_rewrite supporting such URLs. What I need is
javascript in the form to go to that address.

Such as (making it up)

onButtonClick ( go to page "http://www.cooldictionary.com/word." +
word + ".html" );

Any thoughts?

i
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 04-14-2005, 16:00   #2 (permalink)
GreyWyvern
Civilians

 
Default Re: javascript redirect: make filename from query

And lo, Ignoramus21798 didst speak in alt.www.webmaster:

> I currently have a dictionary.
>
> A user enters a word (say, desk) in the "word" box and gets to
>
> http://www.cooldictionary.com/index.mpl?word=desk
>
> I want to change them and get them to
>
> http://www.cooldictionary.com/word.desk.html
>
> Any thoughts?


Don't. Just make "/index.mpl?word=desk" forward you to "/word.desk.html"
using a Location header[1]. People will still be able to just type
"/word.whatever.html" to get a definition, but also
"/index.mpl?word=whatever" will give the same result. Don't complicate
things with a client side script.

While you're at it, drop the .html from your redirected URI.
"http://www.cooldictionary.com/word.desk" looks much cleaner.

Grey

[1] Or if index.mpl is your word-info workhorse, rename it something else
and have change the rewrites for "/word.whatever.html" to point to it.
Your users never need to see the name of this file. Then index.mpl can be
your simple Location director.

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com/ringmaker - Orca Ringmaker: Host a web ring
from your website!
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-14-2005, 20:00   #3 (permalink)
Ignoramus21798
Civilians

 
Default Re: javascript redirect: make filename from query

On Thu, 14 Apr 2005 11:58:39 -0400, GreyWyvern <spam@greywyvern.com> wrote:
> And lo, Ignoramus21798 didst speak in alt.www.webmaster:
>
>> I currently have a dictionary.
>>
>> A user enters a word (say, desk) in the "word" box and gets to
>>
>> http://www.cooldictionary.com/index.mpl?word=desk
>>
>> I want to change them and get them to
>>
>> http://www.cooldictionary.com/word.desk.html
>>
>> Any thoughts?

>
> Don't. Just make "/index.mpl?word=desk" forward you to "/word.desk.html"
> using a Location header[1]. People will still be able to just type
> "/word.whatever.html" to get a definition, but also
> "/index.mpl?word=whatever" will give the same result. Don't complicate
> things with a client side script.
>
> While you're at it, drop the .html from your redirected URI.
> "http://www.cooldictionary.com/word.desk" looks much cleaner.
>
> Grey
>
> [1] Or if index.mpl is your word-info workhorse, rename it something else
> and have change the rewrites for "/word.whatever.html" to point to it.
> Your users never need to see the name of this file. Then index.mpl can be
> your simple Location director.
>


All good points. I will do as you say.

i
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filename in footer Anthony LeBaron Microsoft Applications 1 09-14-2005 16:00
Just pull filename Cardinal Microsoft Applications 1 07-29-2005 12:00
Function: Filename MarkC Microsoft Applications 4 04-23-2005 20:00
VBA Excel Help - Filename pkruti@hotmail.com Microsoft Applications 1 03-08-2005 08:00
Inserting Filename? Bill Allen Microsoft Applications 2 06-16-2004 01:49


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 11:18.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.81605 seconds with 19 queries