Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to manipulate the URL with javascript

    Greetings,

    I didn't know how to properly define my question so here it goes:

    I am trying to add a feature close to myspace on my website where if my website is www.test.com I want www.test.com/X to redirect to somewhere and www.test.com/Y to redirect to somewhere else within test.com.

    When I try to take the URL and manipluate it via javascript I am having the basic problem of PAGE NOT FOUND since www.test.com/X is not recognizable by the server (there's no such a file)

    Please I need some help on this...

    Any ideas?
    thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You may have to use some server side redirects. Which is your server?
    (just see http://www.webconfs.com/how-to-redirect-a-webpage.php)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am renting web hosting from GoDaddy.com

    I know I must enter some server coding .. how is that possible ? thanks

  • #4
    Regular Coder logictrap's Avatar
    Join Date
    Apr 2008
    Posts
    155
    Thanks
    11
    Thanked 3 Times in 3 Posts
    Here's one simple solution:

    1) Create an index.html for each location you want to redirect from.
    2) Use the code below as the index.html file - You only need to change the link highlighted in red below. The link should be where you want the redirect to go to. It could within your site or somewhere else.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="refresh" content="0;url=http://www.test.com/someotherpage.html">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    </head>
    
    <body>
    </body>
    </html>
    Last edited by logictrap; 06-25-2008 at 02:18 PM. Reason: fix typos

    Which came first - the chicken or the egg? The egg... [ticket closed]
    If a tree falls... does it make a sound? Yes.............. [ticket closed]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •