1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Little help with web proxy site needed

Discussion in 'PHP' started by tzau, Jan 17, 2009.

  1. #1
    Hi,

    I'm gonna do few changes about my proxy site.. let say i have proxy.com, and when client is going to surf it goes to proxy.com/index.php?q=aHR0cDovL3d3dy

    now, I want to change domain, so, when client is going to surf, it should to go like proxyblablabla.com/index.php?q=aHR0cDovL3d3dy instead of proxy.org/index.php?q=aHR0cDovL3d3dy


    can anyone help? thanks
     
    tzau, Jan 17, 2009 IP
  2. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #2
    use redirect function on proxy.com/index.php

    put this on header of index.php

    
    <?php
    header("Location: proxyblablabla.com/index.php");
    ?>
    
    PHP:
    or

    in form field source code:

    where <form action="index.php"
    change that to <form action="proxyblablabla.com/index.php"
     
    khan11, Jan 17, 2009 IP
    tzau likes this.
  3. harrisunderwork

    harrisunderwork Well-Known Member

    Messages:
    1,005
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    135
    #3
    If your are changing the domain, you need not do anything.

    I assume that you form code is like this :

    <form method="post" action="index.php">
    Code (markup):
    This will work regardless of domain.
     
    harrisunderwork, Jan 17, 2009 IP
    tzau likes this.
  4. artiskool

    artiskool Peon

    Messages:
    34
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also use the mod_rewrite in apache by creating a .htaccess
     
    artiskool, Jan 17, 2009 IP
    tzau likes this.
  5. tzau

    tzau Well-Known Member

    Messages:
    521
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Thanks for helping me out guys, but looks like I didnt give enough information.
    I'm using php proxy script.

    index.inc.php

    <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">

    index.php:

    $_script_url = 'http' . ((isset($_ENV['HTTPS']) && $_ENV['HTTPS'] == 'on') || $_SERVER['SERVER_PORT'] == 443 ? 's' : '') . '://' . $_http_host . ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 ? ':' . $_SERVER['SERVER_PORT'] : '') . $_SERVER['PHP_SELF'];

    I just want client to surf from another domain not primary one.



    However, I've just figure it out :D

    Thanks anyway
     
    tzau, Jan 17, 2009 IP
  6. proxywhereabouts

    proxywhereabouts Notable Member

    Messages:
    4,027
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    200
    #6
    Enable hotlinking on your proxy but make sure to create a whitelist of domains which are allowed to hotlink to your proxy.
     
    proxywhereabouts, Jan 17, 2009 IP