iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-19-2008, 10:49 PM
WebProWorld Member
 
Join Date: Mar 2006
Location: Colorado
Posts: 79
lukkyjay RepRank 0
Default Keeping linked pages with 301 redirect

I have a pretty big site with a lot of html and php pages including a wordpress blog with over 300 entries. I plan on copying the entire site to a new domain name and keeping the same suffix structure. So, the page www.oldsite.com/subject.html would now be www.newsite.com/subject.html and www.oldsite.com/blog/article123/ would now be www.newsite.com/blog/article123/

What would be the easiest way to setup the 301 redirect so links to internal pages on the old site reach the same internal page on the new site? i.e. - a person clicking on a link to www.oldsite.com/subject.html would be taken to www.newsite.com/subject.html.
Reply With Quote
  #2 (permalink)  
Old 01-20-2008, 07:25 AM
WebProWorld Pro
 
Join Date: Dec 2007
Location: Brussels, Belgium
Posts: 164
Jean-Luc RepRank 2
Default Re: Keeping linked pages with 301 redirect

It's easy. Create a .htaccess file in the old domain:
Code:
RedirectPermanent / http://www.newsite.com/
Jean-Luc
__________________
Checking redirects made easy | | Professional AWStats Services
Reply With Quote
  #3 (permalink)  
Old 01-20-2008, 08:13 AM
WebProWorld Member
 
Join Date: Mar 2006
Location: Colorado
Posts: 79
lukkyjay RepRank 0
Default Re: Keeping linked pages with 301 redirect

Wow. That's way too easy! And the search engines will pass on the rank they have for each internal page in the old site to the internal page in the new site with the same page name huh?

I was planning on having to go into each page in the old site and give it a specific redirect to its new page. You just saved me a LOT of time, thanks!
Reply With Quote
  #4 (permalink)  
Old 01-20-2008, 02:10 PM
mjtaylor's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Dec 2003
Location: Florida Keys/Western NC
Posts: 1,843
mjtaylor RepRank 4mjtaylor RepRank 4mjtaylor RepRank 4mjtaylor RepRank 4
Default Re: Keeping linked pages with 301 redirect

Quote:
Originally Posted by lukkyjay View Post
Wow. That's way too easy! And the search engines will pass on the rank they have for each internal page in the old site to the internal page in the new site with the same page name huh?

I was planning on having to go into each page in the old site and give it a specific redirect to its new page. You just saved me a LOT of time, thanks!
You're right; that's too easy. You absolutely should redirect each individual page to each new page. Take the time; it's important for SEO.

See this thread for help: Canonicalization Prevention Guide and make a Google search site:webproworld.com 301 redirect for more threads on this forum.
__________________
M.-J. Taylor
SEO Web Design by Cyber Key Search Smart DesignŽ SEO Copywriter & Traveling Vacation Gypsy
Reply With Quote
  #5 (permalink)  
Old 01-20-2008, 02:23 PM
WebProWorld Pro
 
Join Date: Dec 2007
Location: Brussels, Belgium
Posts: 164
Jean-Luc RepRank 2
Default Re: Keeping linked pages with 301 redirect

Quote:
Originally Posted by mjtaylor View Post
You're right; that's too easy. You absolutely should redirect each individual page to each new page.
Just follow my suggestion and you will see that it properly redirects each individual page to each new page !

Jean-Luc
__________________
Checking redirects made easy | | Professional AWStats Services
Reply With Quote
  #6 (permalink)  
Old 01-20-2008, 03:09 PM
Webnauts's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Aug 2003
Location: Worldwide
Posts: 8,167
Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9
Default Re: Keeping linked pages with 301 redirect

I fully agree with the suggestion of Jean-Luc.
__________________
"Being an expert isn't telling other people what you know. It's understanding what questions to ask, and flexibly applying your knowledge to the specific situation at hand. Being an expert means providing sensible, highly contextual direction." Jeff Atwood
SEO Workers - Search Engine Optimization Consulting Company | SEO Analysis Tool | Webnauts Net SEO
Reply With Quote
  #7 (permalink)  
Old 01-20-2008, 03:11 PM
mjtaylor's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Dec 2003
Location: Florida Keys/Western NC
Posts: 1,843
mjtaylor RepRank 4mjtaylor RepRank 4mjtaylor RepRank 4mjtaylor RepRank 4
Default Re: Keeping linked pages with 301 redirect

Ah, must be my mistake .. pardon me. I have always done the laborious this page now goes to that page ... and I didn't have to? Apologies to Jean -Luc ...

I see my mistake ... I didn't read the post carefully ... m'bad.

Now, if the page file names changed and the domain stayed the same I *would* need to do file name by file name, correct? I have never changed to a new domain, but I have changed file names when redesigning ... so in that case we do need to change http://domain.com/contact.html to http://domain.com/contact.php and http://domain.com/about-us.html to http://domain.com/about-us.php and so on???
__________________
M.-J. Taylor
SEO Web Design by Cyber Key Search Smart DesignŽ SEO Copywriter & Traveling Vacation Gypsy

Last edited by mjtaylor; 01-20-2008 at 03:19 PM. Reason: asking question
Reply With Quote
  #8 (permalink)  
Old 01-20-2008, 05:05 PM
WebProWorld Pro
 
Join Date: Dec 2007
Location: Brussels, Belgium
Posts: 164
Jean-Luc RepRank 2
Default Re: Keeping linked pages with 301 redirect

Hi mjtaylor,

There are plenty of different cases and sometimes you need to write a lot of rules.

I am afraid there is also an easy solution when all old .html pages become .php pages: you can use this .htaccess:
Code:
RewriteEngine on
RewriteRule ^(.*)\.html$ http://domain.com$1.php [L,R=301]
Jean-Luc
__________________
Checking redirects made easy | | Professional AWStats Services
Reply With Quote
  #9 (permalink)  
Old 01-20-2008, 05:48 PM
mjtaylor's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Dec 2003
Location: Florida Keys/Western NC
Posts: 1,843
mjtaylor RepRank 4mjtaylor RepRank 4mjtaylor RepRank 4mjtaylor RepRank 4
Default Re: Keeping linked pages with 301 redirect

Excellent and thanks, Jean-Luc. So, the only time I would need to write a line for each file name is where the file names are different? For example, if

http://domain.com/page1.html is to change to http://domain.com/keyword1-keyword2.php and http://domain.com/page2.html is to change tohttp://domain.com/keyword1-keyword3.php ... or even

http://domain.com/page1.html is to change to http://domain.com/keyword1-keyword2.html and so on?

Thanks, MJ
__________________
M.-J. Taylor
SEO Web Design by Cyber Key Search Smart DesignŽ SEO Copywriter & Traveling Vacation Gypsy
Reply With Quote
  #10 (permalink)  
Old 01-20-2008, 08:42 PM
WebProWorld Member
 
Join Date: Mar 2006
Location: Colorado
Posts: 79
lukkyjay RepRank 0
Default Re: Keeping linked pages with 301 redirect

Quote:
Originally Posted by Jean-Luc View Post
It's easy. Create a .htaccess file in the old domain:
Code:
RedirectPermanent / http://www.newsite.com/
Jean-Luc
Can that be the only thing I have in the .htaccess file? I did it just the way you have it there and it isn't redirecting and it isn't giving me any error messages. I called my host to make sure .htaccess was activated and they said it is a scripting issue. I'm trying to redirect from this site: Colorado Health Insurance Quotes

to this site: Colorado Health Insurance Quotes

and here is what is in my .htaccess file in the root of healthinsurance-colorado.com:
Code:
RedirectPermanent / http://www.healthinsurancecolorado.net/

Last edited by lukkyjay; 01-20-2008 at 08:44 PM. Reason: added the domain where the .htaccess was
Reply With Quote
  #11 (permalink)  
Old 01-20-2008, 11:59 PM
WebProWorld Pro
 
Join Date: Dec 2007
Location: Brussels, Belgium
Posts: 164
Jean-Luc RepRank 2
Default Re: Keeping linked pages with 301 redirect

This .htaccess file is valid. I just placed it on a test site and I got redirected. Did you place it in the same directory as the index.html of http://www.healthinsurance-colorado.com/ ?

Jean-Luc
__________________
Checking redirects made easy | | Professional AWStats Services
Reply With Quote
  #12 (permalink)  
Old 01-21-2008, 10:39 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,651
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Keeping linked pages with 301 redirect

There is also a less well known directive for accomplishing the same thing without the use of mod_rewrite, called the RedirectMatch. mod_rewrite has a certain potential for security issues if not very carefully implemented, and a RedirectMatch can in most cases accomplish the same tasks.

From www.olddomain.com to www.newdomain.com:

RedirectMatch 301 ^(.*)$ http://www.newdomain.com$1

From www.olddomain.com/file.html to www.newdomain.com/file.php

RedirectMatch 301 ^(.*)\.html$ http://www.newdomain.com$1.php

Fun thing with Apache is that there are almost infinite ways to accomplish almost any task.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #13 (permalink)  
Old 01-21-2008, 03:06 PM
WebProWorld Member
 
Join Date: Mar 2006
Location: Colorado
Posts: 79
lukkyjay RepRank 0
Default Re: Keeping linked pages with 301 redirect

Jean-Luc,
The websites that it wasn't working on were just some test sites I was using to see if it really worked (through godaddy). I went ahead and just used it on my real sites and it works beautifully. It was the same code that godaddy claimed was a "scripting error"
Thanks!

wige,
If I used this:
Code:
RedirectPermanent / http://www.newsite.com/
what security issues would I need to worry about and how could I fix them? Also, what is the most search engine friendly way of accomplishing this with the best security? The thing I like about Jean-Luc's recommendation is the fact that all I needed to do was keep the same page structure and each individual page from the old domain got redirected to the same page on the new domain.
Reply With Quote
  #14 (permalink)  
Old 01-21-2008, 05:28 PM
villageloop's Avatar
WebProWorld Member
 
Join Date: Dec 2007
Location: South Florida
Posts: 71
villageloop RepRank 1
Default Re: Keeping linked pages with 301 redirect

Well the solution seems to be pretty straightforward running on Apache.

But what if you are hosting on a Windows shared plan and do not have direct access to IIS? Do you have to create a script to be included on every page?

We have done this for some other redirects, but not for moving an entire domain.

thanks,
Steven Alig
Reply With Quote
  #15 (permalink)  
Old 01-21-2008, 05:35 PM
Webnauts's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Aug 2003
Location: Worldwide
Posts: 8,167
Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9Webnauts RepRank 9
Default Re: Keeping linked pages with 301 redirect

Quote:
Originally Posted by villageloop View Post
Well the solution seems to be pretty straightforward running on Apache.

But what if you are hosting on a Windows shared plan and do not have direct access to IIS? Do you have to create a script to be included on every page?

We have done this for some other redirects, but not for moving an entire domain.

thanks,
Steven Alig
For single pages you can add this in the pages which should be redirected:

Code:
<%@ Language=VBScript %>
<%
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.yoursite.com/"
Response.End
%>
__________________
"Being an expert isn't telling other people what you know. It's understanding what questions to ask, and flexibly applying your knowledge to the specific situation at hand. Being an expert means providing sensible, highly contextual direction." Jeff Atwood
SEO Workers - Search Engine Optimization Consulting Company | SEO Analysis Tool | Webnauts Net SEO
Reply With Quote
  #16 (permalink)  
Old 01-21-2008, 05:42 PM
WebProWorld New Member
 
Join Date: Jul 2003
Location: Canada
Posts: 2
keltin RepRank 0
Default Re: Keeping linked pages with 301 redirect

Didn't see if you got this resolved or not but you can give this a shot if not.

On the old server add this to .htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
Reply With Quote
  #17 (permalink)  
Old 01-21-2008, 05:45 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,651
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Keeping linked pages with 301 redirect

Actually, my security comment was directed more toward the RewriteRule that Jean-Luc posted:
RewriteEngine on
RewriteRule ^(.*)\.html$ http://domain.com$1.php [L,R=301]

"RedirectPermanent", "Redirect 301" and "Redirect permanent" are all identical commands as far as Apache is concerned. The rewrite commands, however, are processed differently. These use an outside mod, and present additonal processing overhead, and some security issues have been identified in mod_rewrite which powers the Rewrite directives. Most webmasters and SEOs, however, seem more familiar with Rewrite because it is used to perform internal conversions on URLs to make them more search engine friendly. My concept was that if you are not already using mod_rewrite, you can avoid the extra overhead by using a RedirectMatch to accomplish the same task.

The search engines don't care which method you use, because all of these methods cause the server to show the visitor the same end result. It typically comes down to the easiest method to implement, and the safest, depending on your other requirements. My first preference would be the Redirect options, and only using Rewrites if you already have them implemented for other uses on your server.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #18 (permalink)  
Old 01-21-2008, 06:03 PM
WebProWorld New Member
 
Join Date: Oct 2005
Posts: 17
lpoulsen RepRank 0
Default Re: Keeping linked pages with 301 redirect

I am puzzled at this whole exercise.
Why is the site being renamed ?

If you are just changing to a new hosting provider, it seems that the natural thing to do is to change DNS so that the existing URL sends you to the new site with no-one knowing that it is not the same site.

If you are staying with the same provider, and the point is that you have bought a new domain name that you like better, then why move at all? Just point DNS for both names to the same IP address, and install a canonical rewrite to ensure that whatever name people used when they came in, it gets rewritten to the new name. No redirect involved.

Am I misunderstanding the question, or am I missing something else?
Reply With Quote
  #19 (permalink)  
Old 01-22-2008, 03:56 AM
davidweb's Avatar
WebProWorld Pro
 
Join Date: Mar 2007
Posts: 209
davidweb RepRank 1
Default Re: Keeping linked pages with 301 redirect

Hi

You can read more about 301 redirect and its SEO advantage at : 301 Redirect and its SEO Advantage >> SEO HAWK << India

You should also try to make your website technology independant by using urls as website/page rather than website/page.html or php

This will help you migrate from one technology to another without worrying about extension of your web pages.
__________________
SEO Optimization Company - SEO Hawk - UK, US, Canada, and Australia
SEO Optimisation UK | Latest SEO Blog on the Planet http://www.seohawk.com/blog/
Reply With Quote
  #20 (permalink)  
Old 01-22-2008, 08:14 PM
WebProWorld Member
 
Join Date: Jan 2006
Location: LA
Posts: 32
jonisolis RepRank 0
Default Re: Keeping linked pages with 301 redirect

Hi, I am also doing some redirects on my site and need a little help. I have a wordpress blog and installed a plugin called Redirection - Redirection - Manage 301 redirections without modifying Apache | Urban Giraffe

The plugin can use 'regular expressions', and since I have a lot of pages that need redirecting I thought 'regular expressions' would be the best way, but I don't know how to figure it out.

Regular Expressions needed to change this kind of URL...

/blog​/2006​/01​/02​/post-name
to this...
/blog​/post-name

and this
/blog/images/logos/purchased-logos
to this...
/blog/images/logos/horse-logos
__________________
Joni Solis
--- A Love for Horses ~ http://alove4horses.com/ ---
Reply With Quote
  #21 (permalink)  
Old 01-23-2008, 10:48 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,651
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Keeping linked pages with 301 redirect

Quote:
Originally Posted by jonisolis View Post
Regular Expressions needed to change this kind of URL...

/blog​/2006​/01​/02​/post-name
to this...
/blog​/post-name
Easy enough...

/blog/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*) becomes /blog/$4

[0-9]{4} matches any group of 4 numbers, [0-9]{2} matches any group of two numbers, and .* matches any grouping of characters. Everything enclosed in () is assigned to a variable, so since the only part you are keeping is the fourth one, use $4 in the expression to use that value.

Quote:
Originally Posted by jonisolis View Post
and this
/blog/images/logos/purchased-logos
to this...
/blog/images/logos/horse-logos
For something that specific, you would use a literal translation, instead of a regex.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #22 (permalink)  
Old 01-23-2008, 12:50 PM
WebProWorld Member
 
Join Date: Jan 2006
Location: LA
Posts: 32
jonisolis RepRank 0
Default Re: Keeping linked pages with 301 redirect

Thank you wige for the quick help on this! This saved me time from having to make a lot of redirects for each individual URL page.
__________________
Joni Solis
--- A Love for Horses ~ http://alove4horses.com/ ---
Reply With Quote
  #23 (permalink)  
Old 01-23-2008, 12:53 PM
WebProWorld New Member
 
Join Date: Nov 2007
Posts: 19
ursfehr RepRank 0
Default Re: Keeping linked pages with 301 redirect

It's easy. Create a .htaccess file in the old domain:
Reply With Quote
  #24 (permalink)  
Old 01-24-2008, 07:34 PM
PaulMycroft's Avatar
WebProWorld Member
 
Join Date: Jul 2007
Location: Ladysmith, BC, Canada
Posts: 55
PaulMycroft RepRank 1
Default Re: Keeping linked pages with 301 redirect

Hi lukkyjay,

Thought I would throw in my 2 cents.

When you do your 301 redirect, expect to see some temporary drop in traffic while the SEs get to your new site.
__________________
All the best,
Paul Mycroft
Professional Web Design
Reply With Quote
Reply

  WebProWorld > Search Engines > Search Engine Optimization Forum

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keeping all links intact with 301 redirect lukkyjay Search Engine Optimization Forum 6 01-11-2008 12:40 PM
Google has me back linked to fake pages? Texlend Google Discussion Forum 6 09-11-2007 10:45 AM
Crawling non-linked pages? activeco Google Discussion Forum 2 09-13-2004 03:01 AM
Keeping old pages, not visiting new pages climaxphoto Yahoo! Discussion Forum 3 08-24-2004 02:26 AM
Keeping old pages, not visiting new pages climaxphoto Yahoo! Discussion Forum 0 08-19-2004 06:50 PM


All times are GMT -4. The time now is 10:52 PM.



Search Engine Optimization by vBSEO 3.3.0