Simple question about redirects...

Discussion in 'Programming' started by brizzad, May 28, 2006.

  1. #1
    I've just installed this new script for a search engine I'm getting finished up. Whenever you go to www.MYDOMAIN.com, it redirects you automatically to www.MYDOMAIN.com/search/searchscript.php

    My question is, how can I make the address bar at the top say just www.MYDOMAIN.com when the homepage is accessed? I only want it to say that on the homepage, if it says that on every page, then nobody will be able to send links to search results/games/etc.. to others. Is this possible?
     
    brizzad, May 28, 2006 IP
  2. danielbruzual

    danielbruzual Active Member

    Messages:
    906
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    70
    #2
    It looks fine to me in Firefox, Safari, Shiira, Opera and Camino.
     
    danielbruzual, May 29, 2006 IP
  3. brizzad

    brizzad Well-Known Member

    Messages:
    214
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #3
    How does it look fine, I havent posted the url :) .. Thanks for checking though.
     
    brizzad, May 30, 2006 IP
  4. gopher292

    gopher292 Peon

    Messages:
    64
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The way I would do it (And the way I do stuff isn't pretty, but it works):

    Edit the index.htm/php/html/asp/whatever-extension file with a server-side script to open the /search/searchscript.php file and echo it to the user. For example in php:

    <?php
    $page=file_get_contents("http://yourdomain.com/search/searchscript.php);
    echo $page;
    ?>

    You'll want to put some instructions in there for security. (For example http://yourdomain.com/?page=/etc/passwd or something)
     
    gopher292, May 31, 2006 IP
  5. paul.martin

    paul.martin Peon

    Messages:
    260
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'd go for gopher292 approach. It's clean and transparent to the user. The only problem would be the relative links if any in the fetched page.
    Another option would be to make the top page a single frame (html <frameset> tag). But this will require all links on the page to supply a target="_top" attribute to break out of the frame
     
    paul.martin, Jun 6, 2006 IP