Florx
31-05-2007, 12:26 PM
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:
Create a file on the root directory of your website called .htaccess (this probably won't work on free hosts)
Open the .htaccess using notepad (or whatever text editor you like)
Add this to the file
Redirect 301 /old/old.html http://www.you.com/new.htmland 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 (http://www.habboxforum.com/site))
Redirect 301 / http://www.habboxforum.com/site/index.html301 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:
RewriteEngine On
rewritecond %{http_host} ^habboxforum.com
rewriteRule ^(.*) http://www.habboxforum.com/$1 [R=301,L]
^ That will go to http://www.habboxforum.com
\/ This will go to http://habboxforum.com
RewriteEngine On
rewritecond %{http_host} ^habboxforum.com
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 (http://habboxforum.com/%28WHATEVER) 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]
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:
Create a file on the root directory of your website called .htaccess (this probably won't work on free hosts)
Open the .htaccess using notepad (or whatever text editor you like)
Add this to the file
Redirect 301 /old/old.html http://www.you.com/new.htmland 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 (http://www.habboxforum.com/site))
Redirect 301 / http://www.habboxforum.com/site/index.html301 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:
RewriteEngine On
rewritecond %{http_host} ^habboxforum.com
rewriteRule ^(.*) http://www.habboxforum.com/$1 [R=301,L]
^ That will go to http://www.habboxforum.com
\/ This will go to http://habboxforum.com
RewriteEngine On
rewritecond %{http_host} ^habboxforum.com
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 (http://habboxforum.com/%28WHATEVER) 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]