Javascript Redirect help

Status
Not open for further replies.

ibby

Banned
Banned
1,661
2010
688
0
Hello can someone please help me out redirecting by using Javascript?

not for my site, but would like to create a script.

I Would like

Site.com/index.php?something=*

TO

site.com/

Thanks!
 
6 comments
^ Exactly, htaccess would do it more efficiently

Anyway, add this php code in the document and it will work (code is untested but should work)
PHP:
<?php
if (isset($_GET['something'])) {
$baseurl = 'http://' . $_SERVER['HTTP_HOST'];
echo '<script language="javascript" type="text/javascript">window.location.href="' . $baseurl . '";</script>';
}
?>
 
Status
Not open for further replies.
Back
Top