PDA

View Full Version : 301 redirect


chris
06-09-2009, 08:22 PM
Can a novice (i.e. me) do a 301 redirect without causing havoc?

Just had a bit of info that says:
Search engines may think www.morethangifts.co.uk and morethangifts.co.uk are two different sites.You should set up a permanent redirect (technically called a "301 redirect") between these sites.

Yes, easy to say!!!

knotjustjigs
07-09-2009, 07:31 AM
this novice couldn't !
Hope you can sort it without too much trouble ;)

Ketty x

lajlaj
07-09-2009, 08:59 AM
I am looking at this issue at the moment for when (if) my new site ever takes over from the old sites. Basically my new hosts have to put scripts on their server but I'm afraid that is all I understand of it all.

Sorry I know this is probably no help at all.

chris
07-09-2009, 09:36 AM
I don't really know how morethangifts.co.uk has appeared as I always use www.morethangifts.co.uk (I only have 1 domain name).
Perhaps it is something the search engines do.
It is just that this report says I have links to both and it would be better if the links were all directed to one url.
I would love to go on a training course and uinderstand all these things!

Black Cat
07-09-2009, 09:37 AM
have a look at this article here (http://www.webweaver.nu/html-tips/web-redirection.shtml) I used it when I wanted to redirect people away from old (now deleted) pages which were still coming up on Google searches and point them onto new pages.

You'll need to create a .htaccess file on the domain that you want to be redirected, and you'll need to test it LOTS - apparently there's lots of potential for messing things up big time. Sorry - don't mean to scare you, just to warn.

Good luck!

obscure
07-09-2009, 11:00 AM
We use a redirect for this exact reason - and also to ensure its only the .com that is being ranked (as we have the .co.uk of the domain also).

As Lucy says you need to use a .htaccess file (on a linux server may be different on Windows hosting). The code used is as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.glassraven\.com$
RewriteRule ^(.*)$ http://www.glassraven.com/$1 [R=301,L]

This basically takes the non www (of either .com or .co.uk) and redirects it to the www.glassraven.com URL and also redirects www.glassraven.co.uk.

Replace the glassraven with your URL and you'l be set.
HTH :)
Sadie

obscure
07-09-2009, 11:00 AM
We use a redirect for this exact reason - and also to ensure its only the .com that is being ranked (as we have the .co.uk of the domain also).

As Lucy says you need to use a .htaccess file (on a linux server may be different on Windows hosting). The code used is as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.glassraven\.com$
RewriteRule ^(.*)$ http://www.glassraven.com/$1 [R=301,L]

This basically takes the non www (of either .com or .co.uk) and redirects it to the www.glassraven.com URL and also redirects www.glassraven.co.uk.

Replace the glassraven with your URL and you'l be set.
HTH :)
Sadie

obscure
07-09-2009, 11:02 AM
sorry for the double post - don't know what happened there.

chris
07-09-2009, 11:38 AM
Thanks everyone for the replies.

"you need to use a .htaccess file" - that was a step too far for this novice!!

obscure
07-09-2009, 11:46 AM
Hi Chris

Setting up a .htaccess file is really simple.

Open up notepad. Add the info I pasted above editing to your website name, then save it in the root directory of your website (same place your index.php file will be) as .htaccess

Upload to your website and thats it done :)
Sadie

obscure
07-09-2009, 11:46 AM
Hi Chris

Setting up a .htaccess file is really simple.

Open up notepad. Add the info I pasted above editing to your website name, then save it in the root directory of your website (same place your index.php file will be) as .htaccess

Upload to your website and thats it done :)
Sadie

obscure
07-09-2009, 11:47 AM
agh whats going on with my pc??

chris
07-09-2009, 12:38 PM
Hi Chris

Setting up a .htaccess file is really simple.

Open up notepad. Add the info I pasted above editing to your website name, then save it in the root directory of your website (same place your index.php file will be) as .htaccess

Upload to your website and thats it done :)
Sadie

Thank you - that was explained so well that even I think I could have a go - what could go wrong (answers on a postcard please!!).

obscure
07-09-2009, 01:10 PM
If you do find you get any problems (test your website through once you've uploaded it) you can always delete the file and it will revert to how it was .

:) Sadie

chris
07-09-2009, 01:48 PM
If you do find you get any problems (test your website through once you've uploaded it) you can always delete the file and it will revert to how it was .

:) Sadie

Thank you.
Do I have to give the file any particular name? "xxx.htaccess"

obscure
07-09-2009, 03:01 PM
Hi Chris,

It has to be .htaccess nothing else :)

chris
07-09-2009, 04:12 PM
well, I have done something!
Not sure how to check if it has been successful - website is still there thank goodness!!!

megfenn
01-10-2010, 05:00 PM
Hi I have a question about this. I am setting up a 301 re-direct for a whole list of pages. I've got the htaccess page like this:

Redirect 301 /oldpage.htm http://www.samesite.com/index.php

But when I then input oldpage.htm, that old page show up and does not redirect to the new page. What have i done wrong?? Thanks. Obviously i've used the actual file names.

obscure
02-10-2010, 06:56 PM
Hi Meg

Do you have this at the top:
RewriteEngine on

And I assume you've called the file .htaccess with the dot?
:) Sadie

megfenn
04-10-2010, 09:26 AM
Hi Meg

Do you have this at the top:
RewriteEngine on

And I assume you've called the file .htaccess with the dot?
:) Sadie

Ummm, i have this at the top
RewriteEngine on
Options +FollowSymLinks

Should it just be the first line? Also, the file is not called anything but it has.htaccess as the etx. Is that correct?
Thanks so much.

obscure
04-10-2010, 07:37 PM
Hmm that should be right - do you have any other htaccess files in the site which could be conflicting?

Are the files you are referring to deleted?
Sadie

megfenn
07-10-2010, 12:50 PM
AHA, i worked out why it wasn't working!! Their hosting disables .htaccess and they do not allow 301 redirects. Nor do they allow php script redirects. SO, i had to go thru the whole site and do the meta refresh on all the old pages. It was a pain, but at least it's done. The site is massive BTW but at least the old pages are fewer than the new site. Sorry, my grammar is terrible today. Why hosting companies do that, I just don't konw - i guess they have their reasons. Anyways, thanks for all your comments trying to help me. :kisshands: