Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 16th Jan 2012, 03:49 PM   #1
ND
Active Warrior
 
ND's Avatar
 
Join Date: 2011
Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
Default
SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Hi Guys,
I'm taking an old website I have and 301 redirecting it to a brand new site.

The problem is that it has about 20 pages ending in www.oldsite/public_html/oldpage.html
and I want them all to go to my new website which doesnt have html extensions.
www.NEWsite/NEWPAGE


what is the code for redirecting .html to regular webpage?

I tried this...

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.NEW WEBSITE.com/$1 [R=301,L]

But it only works for the homepage!
thanks

NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing:
NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC
ND is offline  
Unread 17th Jan 2012, 06:35 AM   #2
HyperActive Warrior
 
tweakr's Avatar
 
Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

You will probably have to define each one individually if the file names have changed, something like this.

Code:
redirect 301 /current/currentfile.html http://www.newdomain.com/new/newfile
tweakr is offline  
Unread 17th Jan 2012, 08:29 AM   #3
HyperActive Warrior
War Room Member
 
frenchsquared's Avatar
 
Join Date: 2011
Location: Colorado
Posts: 176
Thanks: 6
Thanked 49 Times in 25 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Originally Posted by tweakr View Post

You will probably have to define each one individually if the file names have changed, something like this.

Code:
redirect 301 /current/currentfile.html http://www.newdomain.com/new/newfile

Yep... this would probably be easiest. You said you only have about 20 pages. Im certain there is a dynamic way to do it, but it would be faster just to make the 20 individual ones.

I am a php developer and Wordpress Guru. I was the original coder of Socrates and Metamorphosis. Be on the look out for my NEXT Theme... hopefully you will find it launched as a WSO in the next month or so. Optin for Special Pricing

Need some help with Wordpress? find me on fiverr
frenchsquared is offline  
Unread 19th Jan 2012, 06:26 PM   #4
ND
Active Warrior
 
ND's Avatar
 
Join Date: 2011
Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Originally Posted by tweakr View Post

You will probably have to define each one individually if the file names have changed, something like this.

Code:
redirect 301 /current/currentfile.html http: // www.newdomain.com/new/newfile
ok I tried this...
de
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www. newsite/$1 [R=301,L]
redirect 301 /current/currentfile.html http: // www.newdomain.com/new/newfile

the home page works but the second one goes to
www .NEW WEBSITE/public_html/oldpagename.html/
resulting in a 404 page

(My new wordpress website then says "Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post." with a search box.)

The old website pages were in the public html folder.
Like www .OLD WEBSITE/public_html/oldpagename.html

I want to send it to to new wordpress site at:
www .NEW WEBSITE/newpagename

Is that the problem?
how can I fix that?
thanks!

NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing:
NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC
ND is offline  
Unread 20th Jan 2012, 08:10 PM   #5
ND
Active Warrior
 
ND's Avatar
 
Join Date: 2011
Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

can anyone help me with this please? It's urgent because this website has been offline for 3 days!
thank you

NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing:
NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC
ND is offline  
Unread 21st Jan 2012, 12:25 PM   #6
New Warrior Member
 
Join Date: 2008
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

If it's only 20 pages why don't you manually redirect them? the faster you do it the better for search engines.
But if you want to do it with regexp maybe you can use redirectMatch, try something like this:
RedirectMatch 301 /(.*)$ http...domain.com/$1

Tkato is offline  
Unread 22nd Jan 2012, 02:46 PM   #7
ND
Active Warrior
 
ND's Avatar
 
Join Date: 2011
Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Originally Posted by Tkato View Post

If it's only 20 pages why don't you manually redirect them? the faster you do it the better for search engines.
But if you want to do it with regexp maybe you can use redirectMatch, try something like this:
RedirectMatch 301 /(.*)$ http...domain.com/$1
Tkato,
Thanks.
I am not a programmer. Can you please tell me how to fit that into this code below? Which line do I replace?

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www. newsite/$1 [R=301,L]
redirect 301 /current/currentfile.html http: // www.newdomain.com/new/newfile

thanks

NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing:
NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC
ND is offline  
Unread 22nd Jan 2012, 03:51 PM   #8
HyperActive Warrior
 
tweakr's Avatar
 
Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Here's some code that should redirect all the pages for you.

Code:
RewriteEngine on 
RedirectMatch 301 (.*).html$ http://www.example.com/$1
example.com should be set to the new domain.
tweakr is offline  
Unread 22nd Jan 2012, 07:51 PM   #9
ND
Active Warrior
 
ND's Avatar
 
Join Date: 2011
Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Originally Posted by tweakr View Post

Here's some code that should redirect all the pages for you.

Code:
RewriteEngine on 
RedirectMatch 301 (.*).html$ http://www.example.com/$1
example.com should be set to the new domain.
no change I am afraid.
the home page works but all others goes to
www .NEW WEBSITE/public_html/oldpagename.html/
resulting in a 404 page

I want to send them from the old html pages to brand new, renamed, non-html pages.

can anyone correct this code?

thanks

NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing:
NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC
ND is offline  
Unread 22nd Jan 2012, 09:17 PM   #10
HyperActive Warrior
 
tweakr's Avatar
 
Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Oops, sorry I should have payed more attention when posting. I hate posting code here it always strips something out.

Anyway, there should be a backslash before .html$, I put the code on pastebin

Hopefully it works for you this time.
tweakr is offline  
Unread 23rd Jan 2012, 12:23 AM   #11
ND
Active Warrior
 
ND's Avatar
 
Join Date: 2011
Location: NYC
Posts: 71
Thanks: 20
Thanked 4 Times in 2 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Originally Posted by tweakr View Post

Oops, sorry I should have payed more attention when posting. I hate posting code here it always strips something out.

Anyway, there should be a backslash before .html$, I put the code on pastebin

Hopefully it works for you this time.

Pasted exactly what you posted and it's still the same.
what's going on?
thanks

NOVA CUSTOM PRINTING- Graphic Design, Custom Printed Labels, Stickers, T Shirts & CD/DVD Manufacturing:
NOVA CUSTOM LABEL PRINTING, NOVA CUSTOM T SHIRT PRINTING, NOVA DISC
ND is offline  
Unread 23rd Jan 2012, 03:27 AM   #12
HyperActive Warrior
 
tweakr's Avatar
 
Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

Did you clear your browsers cache?
tweakr is offline  
Unread 23rd Jan 2012, 03:28 AM   #13
Warrior Member
 
Join Date: 2012
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: SEO and 301 Redirect code
Share on: 
fb share twitter share gplus share more share

a 301 Redirect is a permanent redirect which passes between 90-99% of link juice (ranking power) to the redirected page. 301 refers to the HTTP status code for this type of redirect. In most instances, the 301 redirect is the best method for implementing redirects on a website..

hiltonn is offline  
Closed Thread


Bookmarks

Tags
301, code, redirect, seo


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 11:55 PM.