WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2006, 05:46 PM
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default Conditional Redirect with Javascript..

I found another web site has copied one of my websites.. designs, navigation, etc..

They are even linking to a javascript on my server..

What I wondering if it is possible to initiate a redirect whenever someone views
the copied site, and invokes the javascript from my server..

i.e. visitor is viewing www.badsite.com
When the javascript on my site is called..

if hostsite=badsite{
window.location="http://www.mydomain.com/
}else{
normal script functions
}


To bring them over to my site..

Make sense?

Thanks!
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #2 (permalink)  
Old 06-28-2006, 06:22 PM
WebProWorld Veteran
 

Join Date: Mar 2006
Location: Maryland, USA
Posts: 955
weslinda RepRank 2
Default You could do that...or?

You could do that, or you could simply change the name of the script, and that will cause a bit of havic with their sites, as long as the script is very important.

You can also close off access to the source of your pages with a script that would stop them from being able to copy your design as easily.
Reply With Quote
  #3 (permalink)  
Old 06-28-2006, 09:18 PM
stymiee's Avatar
WebProWorld Veteran
 

Join Date: May 2006
Location: New Jersey
Posts: 431
stymiee RepRank 0
Default

You should consider using .htaccess' hotlink protection. That way you can block them completely and even create havoc on their website.
__________________
John Conde
Brainyminds Merchant Account Services eBook Giant
Reply With Quote
  #4 (permalink)  
Old 06-28-2006, 09:41 PM
WebProWorld Veteran
 

Join Date: Mar 2006
Location: Maryland, USA
Posts: 955
weslinda RepRank 2
Default Not familiar with this...

Hey Stymiee, can you send a link or something with more information on this? This is a feature set I am not familiar with.
Reply With Quote
  #5 (permalink)  
Old 06-28-2006, 10:09 PM
stymiee's Avatar
WebProWorld Veteran
 

Join Date: May 2006
Location: New Jersey
Posts: 431
stymiee RepRank 0
Default

Preventing Hotlinking with Apache mod_rewrite

Not only can you block them completely, but you can even send them bogus files. If someone is hotlinking to an image file you can send another file in its place that says they are stealing from you or worse. ;)
__________________
John Conde
Brainyminds Merchant Account Services eBook Giant
Reply With Quote
  #6 (permalink)  
Old 06-28-2006, 10:11 PM
WebProWorld Veteran
 

Join Date: Mar 2006
Location: Maryland, USA
Posts: 955
weslinda RepRank 2
Default Thanks...

Nice, learn something new every day. Now I can head off to bed.
Reply With Quote
  #7 (permalink)  
Old 06-29-2006, 02:51 AM
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default

The .htaccess is do-able.. and I can substitute a different javascript..but,

I was hoping to use the redirect in the existing file to get the visitors to my site..
since the offender is in the same market as our site.

So can anyone provide a javascript solution?
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #8 (permalink)  
Old 07-26-2006, 10:29 AM
sands's Avatar
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default Re: Conditional Redirect with Javascript..

Quote:
Originally Posted by steve0
i.e. visitor is viewing www.badsite.com
When the javascript on my site is called..

if hostsite=badsite{
window.location="http://www.mydomain.com/
}else{
normal script functions
}

To bring them over to my site..
Sorry for the belated reply to this post. Somehow I missed it. Anyway if still interested try this code:
Code:
if (document.title=="The Bad Site's Title") { location.href="http://www.mydomain.com/"; }
Add it to the top of your .js file they are linking to. i.e. find out the Bad Site document title and paste it in the code above. This will redirect the visitors to Bad Site to your site if the title matches.
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #9 (permalink)  
Old 07-26-2006, 08:09 PM
WebProWorld New Member
 

Join Date: Jul 2006
Posts: 24
martyn-it RepRank 0
Default

If you put this in the top of the JS pf it's not your sites url it will redirect to your url

Code:
if(document.domain.toLowerCase() !='www.yoururl.com') {window.location='http://www.yoururl.com'}
__________________
Martyn
Martyn-it
Reply With Quote
  #10 (permalink)  
Old 07-26-2006, 08:37 PM
sands's Avatar
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default

Quote:
Originally Posted by martyn-it
Code:
if(document.domain.toLowerCase() !='www.yoururl.com') {window.location='http://www.yoururl.com'}
Yes, this is one more option. If you want you could also have an alert popup that gives notice of the fact that Bad Site is stealing content:
Code:
if (location.href=='http://www.badsite.com') { window.alert("Warning, BadSite.com is stealing content from MyDomain.com!\nYou shall now be redirected to MyDomain.com!"); location.href="http://www.mydomain.com"; }
__________________
My Nook | My Biz | My Photos
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

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

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


Search Engine Optimization by vBSEO 3.2.0