View Full Version : How to manipulate the URL with javascript

06-16-2008, 01:42 PM

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?

06-16-2008, 02:17 PM
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)

06-23-2008, 08:05 PM
I am renting web hosting from GoDaddy.com

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

06-25-2008, 03:17 PM
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.

<!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">
<meta http-equiv="refresh" content="0;url=http://www.test.com/someotherpage.html">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />