Unstoppable Domains โ€” Expired Auctions

To change existing url base on IPs

SpaceshipSpaceship
Watch
Impact
49
Hi,

Let's say my page has been coded with <a href="http://abc.com/a.xls">A</a>.
I have 2 constant ips to browse the page,
1st IP: 123.123.12.12
2nd IP: 124.124.12.12

1st ip to browse the page, the link url is http://abc.com/a.xls
2nd ip to browse the page, the link url is http://xyz.com/a.xls

Do you think it is doable?
Would pay USD10 for javascript.

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Hi,

A better way to do this would be PHP. Replace:

<a href="http://abc.com/a.xls">A</a>

with:

PHP:
<a href="http://<?php echo ($_SERVER['REMOTE_ADDR' == '123.123.12.12']) ? 'abc.com/a.xls' : 'xyz.com/a.xls'; ?>">A</a>
Now rename your HTML file to end with ".php", upload it and try it out. The abc.com link will show if your IP is 123.123.12.12, otherwise the xyz.com link will show.


I don't think it is possible for JavaScript to detect the IP address directly. You can use a trick using SSI to detect the IP address, then javascript to display a different link. You may need to rename your HTML to end .shtml for this to work:

Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
var ip = '<!--#echo var="REMOTE_ADDR"-->';
if (ip == '123.123.12.12') {
    document.write('<a href="http://abc.com/a.xls">A</a>');
} else {
    document.write('<a href="http://xyz.com/a.xls">A</a>');
}
//  -->
</script>
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy โ€” Payment Flexibility
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back