PDA

View Full Version : Redirect web page


Jen
June 12th, 2007, 05:11 PM
Hi guys
Im having a problem with redirecting my web page to a different domain.

I dont want to redirect my entire site, just the index.

This is what I have in my htaccess

redirect 301
/index.html (old site)
http://mysite.com/2007/home/50028 (new site)


Is this not right? Am I missing something?

Thanks
Jen

Dale
June 12th, 2007, 05:19 PM
I use this code for redirects:

<META HTTP-EQUIV="REFRESH" CONTENT="SECONDSGOHERE;URL=NEWLINKGOESHERE">

Replace "SecondsGoHere" with the number of seconds till redirect and "NEwLinkGoesHere" with the link to redirect. The code goes in your "index" file. :)

Greg-J
June 12th, 2007, 05:29 PM
Not what she meant. A 301 redirect will also tell the search engines where you've moved. meta refreshes are definitely not the way to go.

If what you have isn't working, put this in your .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yournewsite.com/$1 [L,R=301]

Jen
June 12th, 2007, 05:32 PM
Thanks Greg, that didnt work either...GRRR

Making me mad, lol

I can redirect the entire site, but I dont want that, lol...

minnseoelite
June 12th, 2007, 05:39 PM
I use this code for redirects:

<META HTTP-EQUIV="REFRESH" CONTENT="SECONDSGOHERE;URL=NEWLINKGOESHERE">

Replace "SecondsGoHere" with the number of seconds till redirect and "NEwLinkGoesHere" with the link to redirect. The code goes in your "index" file. :)

just wanted to let you know that using Meta or Javascript redirects are frowned upon by search engines because that is the same method people use when trying to cloak and other blackhat methods. You might be safe but more than likely you are receiving some sort of penalty for it.

You should always try to use a 301 redirect this also has the added benefit of transferring over all your domains link and PR credit to the new domain :)

Dale
June 12th, 2007, 05:40 PM
Oh, lmao, sorry Greg. Hmm, what Greg said should work?

Dale
June 12th, 2007, 05:42 PM
just wanted to let you know that using Meta or Javascript redirects are frowned upon by search engines because that is the same method people use when trying to cloak and other blackhat methods. You might be safe but more than likely you are receiving some sort of penalty for it.

Well sorry, I haven't actually used the code, I don't usually do redirects :P If I do, I'll google a redirect.

Jen
June 12th, 2007, 05:45 PM
Got it to work with this

RewriteEngine On
rewritecond %{http_host} ^oldsite.com
rewriteRule ^(.*) http://newsite.com/$1 [R=301,L]

Minus the Options +FollowSymLinks

Go figure.

Thanks guys. I was wrecking my brains out.

Dale
June 12th, 2007, 05:50 PM
Glad it worked Jen :)

Jen
June 16th, 2007, 07:47 PM
Okie Dokie, dont know why I didn't check this before but it's only redirecting the site without the www. in front. How can I have it redirect it with the www. in front? LOL

Ad disengaged
June 16th, 2007, 07:48 PM
php 301 or rewrite

Jen
June 16th, 2007, 08:00 PM
I am using a rewrite

Got it to work with this

RewriteEngine On
rewritecond %{http_host} ^oldsite.com
rewriteRule ^(.*) http://newsite.com/$1 [R=301,L]

Minus the

Options +FollowSymLinks

Go figure.

Thanks guys. I was wrecking my brains out.

Jordan
June 16th, 2007, 08:04 PM
Okie Dokie, dont know why I didn't check this before but it's only redirecting the site without the www. in front. How can I have it redirect it with the www. in front? LOL
Put www in front of the url? right now you have:

rewriteRule ^(.*) http://newsite.com/$1 [R=301,L]

If you want www in front shouldn't it be http://www.newsite.com ?

I don't know much about htaccess but I thought that would be the obvious solution :whistling:

offthedome
June 16th, 2007, 08:13 PM
Not what she meant. A 301 redirect will also tell the search engines where you've moved. meta refreshes are definitely not the way to go.

If what you have isn't working, put this in your .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yournewsite.com/$1 [L,R=301]
Congrats on post #3000!!