Results 1 to 5 of 5

Thread: Redirecting people to the typed in address.

  1. #1
    Join Date
    Sep 2008
    Location
    Estonia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Redirecting people to the typed in address.

    Hi, another noob here, I have been looking for a script I can't find anywhere can you help?

    I have 4 addresses and 1 domain. Since they're all on the same domain, I can really have only one index page. So I would like to come across a script that I can add to my index page(first address) to redirect client to another address, if they have typed another address to the address bar.

    Example.
    Client types in address http://www.firstpage.com/, but actually ends up on another page's index > lets say she arrives here http://www.secondpage.com/, but this page has a script in it that detects what the client has written in her address bar and thus redirects her on the page http://www.firstpage.com/...

    Any help is welcome

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Does your host not provide domain pointers?

    You can use php to redirect, .htaccess as well.. many things, but you want to appear to have 4 different sites, then pointers are the way to go.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Jul 2008
    Posts
    199
    Thanks
    6
    Thanked 58 Times in 57 Posts

    Default

    Not sure if this is what you're looking for, but this is what I interpreted from your message.

    Client does to http://seconddomain.com/(STUFF HERE) and gets redirected to http://firstdomain.com/(SAME STUFF HERE). If that's what you're trying to accomplish, create a .htaccess file on http://seconddomain.com and place the following contents in it:
    Code:
    RewriteEngine On
    RewriteRule (.*) http://firstdomain.com/$1 [R]
    (replace firstdomain.com with your real domain)

  4. #4
    Join Date
    Sep 2008
    Location
    Estonia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sadly my host is an Estonian company that only sells web spaces without any scripting support/help.

    The other pages can be other folders as long as the redirecting works. Lets say the client enters firstpage.com in the address-bar and ends up on secondpage.com, but is then redirected in an instant to "info.firstpage.com
    It really doesn't matter where she ends up as long as the .com site she entered ends up the content page that she was looking for.

    I actually don't need to redirect people on all four sites, right now I would like the two most active addresses to work like described.

  5. #5
    Join Date
    Sep 2008
    Location
    Estonia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by techietim View Post
    Not sure if this is what you're looking for, but this is what I interpreted from your message.

    Client does to http://seconddomain.com/(STUFF HERE) and gets redirected to http://firstdomain.com/(SAME STUFF HERE). If that's what you're trying to accomplish, create a .htaccess file on http://seconddomain.com and place the following contents in it:
    Code:
    RewriteEngine On
    RewriteRule (.*) http://firstdomain.com/$1 [R]
    (replace firstdomain.com with your real domain)
    I think this is an excellent idea. The funny thing is I've never heard of htaccess, but I'm google'ing it allready. Thanks for the hint - I'm really impressed by the fast replies cheers!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •