Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default [TUTORIAL] How to redirect a webpage - the clever way.

    The best way to redirect a page is to use something called a "301 Redirect". What this 301 does is redirects to a different page. What makes 301 redirect the best, is that not only does it redirect, it does it safely and search engine friendly too!

    HTML Redirection

    How do you redirect using HTML? Here is how: DON'T!!!

    The result of using META refresh is that when you use it the page WILL be de-indexed from every search engine.

    NOTE: This also applies to javascript redirection. Search engines can easily detect javascript and meta tag redirection, so just dont do it, use the 301 redirect.

    301 Redirect Using htaccess


    Using htaccess to do the 301 redirect is highly suggested due it being easy to manager rather than setting redirects on each page.

    Here is how to do it:
    1. Create a file on the root directory of your website called .htaccess (this probably won't work on free hosts)
    2. Open the .htaccess using notepad (or whatever text editor you like)
    3. Add this to the file
    Code:
    Redirect 301 /old/old.html http://www.you.com/new.html
    and edit that to fit how you need it.

    To redirect the main page of your site to a new directory (e.g. www.habboxforum.com/site)

    Code:
    Redirect 301 / http://www.habboxforum.com/site/index.html
    301 Redirect using Mod_Rewrite

    Mod_rewrite is extremely usefull for changing your site from http://www.habboxforum.com to http://habboxforum.com or vice versa. To do this create a .htaccess file and open it ready for editing:

    Code:
       [FONT='Courier New',Courier,monospace]RewriteEngine On[/font]
      [FONT='Courier New',Courier,monospace]rewritecond %{http_host} ^habboxforum.com [/font]
      
     
    rewriteRule ^(.*) http://www.habboxforum.com/$1 [R=301,L]
    ^ That will go to http://www.habboxforum.com

    \/ This will go to http://habboxforum.com

    Code:
        [FONT='Courier New',Courier,monospace]RewriteEngine On[/font]
       [FONT='Courier New',Courier,monospace]rewritecond %{http_host} ^habboxforum.com [/font]
       
      
    rewriteRule ^(.*) http://habboxforum.com/$1 [R=301,L]
    How does it work?

    So come on Jake how does that actually work?

    RewriteEngine On // That turns on the engine so it will work
    rewritecond %{http_host} ^habboxforum.com // That asks the browser if your address is any file under habboxforum.com
    rewriteRule ^(.*) http://habboxforum.com/$1 [R=301,L] // If its true send the user to http://habboxforum.com/(WHATEVER FILE THEY WERE TRYING TO LOOK AT)

    So thats is for the tutorial. If you need help just plonk a post below and I will try and help you!!!

    Thanks,
    Jake

    [/i]
    Last edited by Nick-; 01-06-2007 at 08:48 AM.

  2. #2
    Join Date
    Jan 2006
    Location
    Cambridge
    Posts
    1,911
    Tokens
    0

    Latest Awards:

    Default

    not a bad tut at all +REP
    EDTALKING


  3. #3
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    PHP Code:
    <?php
    header
    ('Location: page.htm');
    die();
    ?>
    Simple.


    Good tut though, rep+
    James


    Connected to reality through a proxy server.

  4. #4
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,907
    Tokens
    0

    Latest Awards:

    Default

    You can just use the section Redirects in cpanel.

  5. #5
    Join Date
    Aug 2006
    Location
    United Kingdom
    Posts
    3,843
    Tokens
    1,121

    Latest Awards:

    Default

    Quote Originally Posted by :Liam View Post
    You can just use the section Redirects in cpanel.
    ^^ Thas what i use

  6. #6
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    wt if you use plesk OR if its on localhost.


  7. #7
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    PHP Code:
    <?php
    header
    ('Location: page.htm');
    die();
    ?>
    Then use that.If its a HTML file, use your method
    James


    Connected to reality through a proxy server.

  8. #8
    Join Date
    Sep 2006
    Location
    Doncaster, UK
    Posts
    4,081
    Tokens
    0

    Latest Awards:

    Default

    META?

    Anywho, nice tutorial
    Quote Originally Posted by Nain View Post
    i voted 'Not Sure' as im, not sure!

  9. #9
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Code:
    <meta http-equiv="refresh" content="0;url=link.html">
    Don't use it though

  10. #10
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by FlorX View Post
    Code:
    <meta http-equiv="refresh" content="0;url=link.html">
    Don't use it though
    Why? it doesnt harm you?

Page 1 of 2 12 LastLast

Posting Permissions

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