Javascript to move to a specific site from a specific URL

Base belongs to me.
๐Ÿ‘‘ Administrator
๐ŸŒ  Staff
โœ”๏ธ HL Verified
๐Ÿš‚ Steam Linked
Discord Member
Joined
Nov 30, 2002
Messages
10,817
Best answers
0
Is this possible? I'd like to have a script that automatic forwards the person to another site on a specific URL. Like for example this thread.

Once the person goes to:
http://forum.esforces.com/threads/77236-Javascript-to-move-to-a-specific-site-from-a-specific-URL

(See the bold). It goes to for example google.com and only if the person goes to that specific URL. No htaccess btw! Must be javascript.
 
New Member
โœ”๏ธ HL Verified
Joined
Mar 20, 2010
Messages
4
Best answers
0
If i understood right what you meant, this would be what you wanted:

Code:
<*script type="text/javascript">

window.location="http://site-redirects-here.com";

<*/script>
 
Last edited by a moderator:
New Member
โœ”๏ธ HL Verified
Joined
Mar 20, 2010
Messages
4
Best answers
0
A reply for Skyrider about javascript

So i posted you a piece of code inside the code tags, but it seems
that this forum has Javascript enabled in the messages.

You should remove the javascript from messages, since now my piece of code messed up the whole thread! If you look at the Skyriders post, you will see it redirects to other site... It could be used to make nasty things..

The original script was (without****) ^^ :

<****script type="text/javascript">
window.location="http://site-redirects-here.com";
<****/script>

It automatically redirects the visitor to another site, when included in the file.
 
Last edited:
Super Moderator
๐Ÿ’ป Oldtimer
Discord Member
Joined
Dec 1, 2001
Messages
3,125
Best answers
0
Your post has been edited and Sky's thread is fixed. I'll make sure he sees this as well.

Cheers.
 
Base belongs to me.
๐Ÿ‘‘ Administrator
๐ŸŒ  Staff
โœ”๏ธ HL Verified
๐Ÿš‚ Steam Linked
Discord Member
Joined
Nov 30, 2002
Messages
10,817
Best answers
0
You can post Javascript because:
HTML code is On
I'll fix this though.

And thanks! But this is not what I'm looking for. I don't just want "a" forward.. I want a specific URL forward. I don't want every single page to forward to a new site, only a specific URL.
 
Active Member
๐Ÿ’ป Oldtimer
โ˜… Black Lounger โ˜…
โœ”๏ธ HL Verified
Joined
Jul 14, 2002
Messages
6,873
Best answers
0
Just create a thread and insert the code.
 
Base belongs to me.
๐Ÿ‘‘ Administrator
๐ŸŒ  Staff
โœ”๏ธ HL Verified
๐Ÿš‚ Steam Linked
Discord Member
Joined
Nov 30, 2002
Messages
10,817
Best answers
0
Just create a thread and insert the code.
This is non-related to the forums or ESF Damaera. It's on another site. Merely gave this thread as an example.
 
New Member
๐Ÿ’ป Oldtimer
โœ”๏ธ HL Verified
Joined
Mar 29, 2003
Messages
4,765
Best answers
0
I don't get it, what exactly do you want?

If you want a link, you can just use HTML code.
But...you want a specific page, to link to another page? The Javascript posted above should suffice then, not?

I mean. If you have a webpage A. You link to a webpage B on A. When you enter the above Javascript on webpage B, you can automatically link page B to a page C.
 
Base belongs to me.
๐Ÿ‘‘ Administrator
๐ŸŒ  Staff
โœ”๏ธ HL Verified
๐Ÿš‚ Steam Linked
Discord Member
Joined
Nov 30, 2002
Messages
10,817
Best answers
0
I don't get it, what exactly do you want?

If you want a link, you can just use HTML code.
But...you want a specific page, to link to another page? The Javascript posted above should suffice then, not?

I mean. If you have a webpage A. You link to a webpage B on A. When you enter the above Javascript on webpage B, you can automatically link page B to a page C.
Let me just tell in details what I want exactly.

We (FileFront) have a new website TF2Files.com for all Team Fortress related news & files.. How ever, google results for TF2files & Team Fortress 2 files will be this:

http://halflife2.filefront.com/files/Team_Fortress_2;109index/

We no longer use hl2files for TF2files, thus I want people who go to http://halflife2.filefront.com/files/Team_Fortress_2;109index/ <-- in bold to be moved to another site/URL.

Since I only have access to add javascript to the left & right menu rather than specific pages.. I have to do it like this. The javascript that I add in the menu's effect the whole website. And if I add the above javascript code, it will effect every single page which I don't want.
 
New Member
๐Ÿ’ป Oldtimer
โœ”๏ธ HL Verified
Joined
Mar 29, 2003
Messages
4,765
Best answers
0
Someone correct me if I am wrong, but I think that is because of the structure of the website. No different Javascript will change that, because that page is integrated into the rest of the website (through PHP or something similar I guess?) all changes added to that page, will affect the entire website. The page you posted is a request from a database, not really a specific URL. I think the only other way you can solve that is to change the PHP (or whatever language is used) to redirect to a different URL whenever that specific query is being requested from the database.

Why not, instead of adding a 'dirty' way to redirect your page, get a Googlebot to go to your new page and try to get it higher in the ranking. Hell, maybe if you contact Google yourself, and tell them the page name has changed, but it still shows up as the old page in Google, they might be able to help you. Google wants their search functions to be as accurate as they can, it would only be in their best interest to help you.
 
Member
โœ”๏ธ HL Verified
Discord Member
Joined
Oct 16, 2006
Messages
379
Best answers
0
Like Sicron said, contact google, recheck all your meta tags, and search google for redirecting your website.
You can also use a metatag for redirecting(in case google's bot doesnt support javascript):

PHP:
<meta http-equiv="refresh" content="0;url=http://www.google.nl">
 
New Member
๐Ÿ’ป Oldtimer
โœ”๏ธ HL Verified
Joined
Mar 29, 2003
Messages
4,765
Best answers
0
The metatag wouldn't work I think. Because he can only add JavaScript to the side-menu's. Adding this metatag would give him the same problem as with the JavaScript, it would send every page [that contains those side-menu's] to google.nl.
 
Member
โœ”๏ธ HL Verified
Discord Member
Joined
Oct 16, 2006
Messages
379
Best answers
0
How about:

PHP:
if ( location.hostname == "filefront.com" || location.hostname == "halflife2.filefront.com" ) { 
 
	window.location = "http://TF2Files.com"; 
 
}
 
Base belongs to me.
๐Ÿ‘‘ Administrator
๐ŸŒ  Staff
โœ”๏ธ HL Verified
๐Ÿš‚ Steam Linked
Discord Member
Joined
Nov 30, 2002
Messages
10,817
Best answers
0
How about:

PHP:
if ( location.hostname == "filefront.com" || location.hostname == "halflife2.filefront.com" ) { 
 
	window.location = "http://TF2Files.com"; 
 
}
Woulnd't that just redirect from hl2files to tf2files?
 
New Member
๐Ÿ’ป Oldtimer
โœ”๏ธ HL Verified
Joined
Mar 29, 2003
Messages
4,765
Best answers
0
It would, you might be able to change the location.host name to http://halflife2.filefront.com/files/Team_Fortress_2;109index/ though, not sure if it will work. Because the Team_Fortress_2;109index/ part is dynamic, and might not be read as an actual URL.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top