Submit Your Article Forum Rules

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Redirect existing redirects

  1. #1

    Redirect existing redirects

    Some time ago, we moved all of our articles from our catchall /html/ directory to a new /articles/ directory under the root and did a 301 redirect on all the moved article pages.

    We are redoing our site structre and are creating a series of subdirectories under the /articles/ directory to further subclassify our articles. The number of article pages is approx 200 on our 400 page website. Should we just add another 200 lines to our .htacces file, adding to the original redirects? That is, for each page, should we have this in our .htaccess:

    Redirect permanent /html/articlename.html http://www.oursite.com/articles/articlename.html
    Redirect permanent /articles/articlename.html http://www.oursite.com/articles/newdir/articlename.html

    There is no simple rule for the redirects, so a RedirectMatch won't work -except maybe a match on the precise article name. (That could cut two lines down to one.) Also, most of the article pages have at least one external inbound link. Most importantly, we don't want to lose our existing link juice. Can we do some kind of match on each article name? Is writing the new 301 redirect lines in our .htaccess the best way to go, or is there a better option?

    Thank you in advance for your suggestions.

  2. #2
    WebProWorld MVP danlefree's Avatar
    Join Date
    Jun 2005
    Posts
    414

    Re: Redirect existing redirects

    If you are running PHP, this PHP 301 redirect script might come in handy. The script could be extended to search your web root filesystem or a database for URI:redirect comparisons.
    Dan LeFree | Owner/Operator (Web development, marketing)

  3. #3
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: Redirect existing redirects

    But if you can, avoid it.

    Personally, I often view, and have experienced a redirected redirect as spam.

  4. #4
    Senior Member Ace's Avatar
    Join Date
    Jul 2004
    Posts
    373

    Re: Redirect existing redirects

    Google will surly treat so much redirection as a Spam check Google Guidelines, Google has suggested to do minimal redirection and that too when necessary.
    Ace

  5. #5
    WebProWorld MVP Doc's Avatar
    Join Date
    Jun 2009
    Location
    Baja California, Mexico
    Posts
    927

    Re: Redirect existing redirects

    From what I have read, published by Google's Talking Heads, an occasional redirect, for instance, when reorganizing your site, such as you are doing, is acceptable, and wouldn't necessarily be penalized. However, IMO, doing so with 200 pages, would be really pushing the envelope, and might get you entangled in a Google spam filter. I would recommend a different method. I think it's also worth noting that even if you don't experience any filter problems, it's still probable that you'll be losing at least some of your current juice.

  6. #6
    WebProWorld MVP danlefree's Avatar
    Join Date
    Jun 2005
    Posts
    414

    Re: Redirect existing redirects

    Note on the redirect script - if a redirect is configured for the original URI and the new URI to redirect, you should only have one redirect per URI (as kgun and Ace mentioned, it is inadvisable to create multiple redirects).

    That script shouldn't be the first choice for handling wholesale directory renaming - it's better as a tool for handling one-off changes and URI's which are rarely visited.

    If you're moving directories, you'll be served even better by some mod_rewrite directives (assuming an Apache environment).
    Dan LeFree | Owner/Operator (Web development, marketing)

  7. #7

    Re: Redirect existing redirects

    Thank you for all of your suggestions. I think you have got me on the right track. I checked out mod_rewrite (we are on an Apache box) and have constructed the following to go in the .htaccess in our root directory:

    RewriteEngine on
    RewriteBase /
    RewriteRule ^[(html|articles)]/articlename\.html$ http://www.businessperform.com/articles/newdir/articlename.html [R=301,L]

    articlename.html and /newdir/ will be different for each of our articles and the last line is repeated for each articlename.html. I'm hoping this will redirect url requests for articles in our /html/ and our /articles/ directories to the new position in /articles/newdir/

    I welcome any comments or suggestions.

    Regards, Les

  8. #8
    WebProWorld MVP danlefree's Avatar
    Join Date
    Jun 2005
    Posts
    414

    Re: Redirect existing redirects

    Quote Originally Posted by office7 View Post
    Code:
    RewriteEngine on
    RewriteBase /
    RewriteRule ^[(html|articles)]/articlename\.html$ http://www.businessperform.com/articles/newdir/articlename.html [R=301,L]
    articlename.html and /newdir/ will be different for each of our articles and the last line is repeated for each articlename.html. I'm hoping this will redirect url requests for articles in our /html/ and our /articles/ directories to the new position in /articles/newdir/
    The directives which you specified will probably not perform as you would want... try these:

    Code:
    RewriteEngine on
    
    # /html/* and /articles/* => /articles/newdir/*
    RewriteCond %{REQUEST_URI} ^/(html|articles)/ [NC]
    RewriteRule (html|articles)(.*) http://www.businessperform.com/articles/newdir$2 [R=301,L]
    
    # Host rewrite (non-www => www)
    RewriteCond %{HTTP_HOST} !^www\.businessperform\.com [NC]
    RewriteRule .? http://www.businessperform.com%{REQUEST_URI} [R=301,L]
    Dan LeFree | Owner/Operator (Web development, marketing)

  9. #9
    Senior Member
    Join Date
    Jun 2009
    Posts
    207

    Re: Redirect existing redirects

    Quote Originally Posted by office7 View Post
    Some time ago, we moved all of our articles from our catchall /html/ directory to a new /articles/ directory under the root and did a 301 redirect on all the moved article pages.

    We are redoing our site structre and are creating a series of subdirectories under the /articles/ directory to further subclassify our articles. The number of article pages is approx 200 on our 400 page website. Should we just add another 200 lines to our .htacces file, adding to the original redirects? That is, for each page, should we have this in our .htaccess:

    There is no simple rule for the redirects, so a RedirectMatch won't work -except maybe a match on the precise article name. (That could cut two lines down to one.) Also, most of the article pages have at least one external inbound link. Most importantly, we don't want to lose our existing link juice. Can we do some kind of match on each article name? Is writing the new 301 redirect lines in our .htaccess the best way to go, or is there a better option?

    Thank you in advance for your suggestions.
    I can tell you what I did and when i had a situation just like yours.

    For some URL restructuring problem, I had to 301 redirect about 900 pages in my forum. A plugin actually created that problem. So I wrote 900*3 [*3 because of some URL structure issues] which equals to 2700 plus few more lines in .htaccess file.

    I did that and after a year or so, I came to know about the URL removal option in GWMTs. So I thought why not remove all these redirects and remove the old pages via this feature in GMWTs.

    I did that: all old URLs were removed by Google and my .htaccess file was empty again. Now after 1+ years of doing that: I see no change in anything. Everything seems to be the same as they were 2+ years back when I did not used that plugin which messed up all URLs.

    But reading Doc and Kgun comments, it looks like too much redirects can cause a penalty. May be I did not got it, but you should consider other options as well, in order to avoid any penalty.

  10. #10

    Getting mod_rewrite syntax right

    Thank you Angilina and Dan for your comments. Dan, I had a close look at your suggested code. I can see that it would work very well if there was going to be just one subdir under /articles/

    In fact, we will have 19 new subdirectories under /articles/ In my posts, I used /newdir/ as a variable for these 19 new subdirs.

    To give you two examples:

    http://www.businessperform.com/html/fear_factor.html and
    http://www.businessperform.com/articles/fear_factor.html will redirect to http://www.businessperform.com/articles/management/fear_factor.html


    http://www.businessperform.com/html/team_learning.html and
    http://www.businessperform.com/articles/team_learning.html will redirect to
    http://www.businessperform.com/articles/teams/team_learning.html


    There is no rule that determines whether fear_factor.html and team_learning.html will redirect to the /articles/management/ subdir or the /articles/teams/ subdir or any of the other 17 new subdirs. These allocations are decided by a human (namely me). And this goes for all our 200 articles. I can't see a way of avoiding having 200 lines in the htacess file. But that's no bother at all. It's getting the mod_rewrite syntax right that worries me. Dan, how should I modify your excellent code to accommodate the 19 new subdirs? Thanks in advance for your great help. Much appreciated.

    Regards, Les

Page 1 of 2 12 LastLast

Similar Threads

  1. We pay for 100% of your existing traffic
    By freewebsitetools in forum Ad Space Buy and Sell
    Replies: 0
    Last Post: 05-14-2008, 04:29 PM
  2. CSS - How to Format Existing Text Within a DIV Tag
    By fisher318 in forum Web Programming Discussion Forum
    Replies: 3
    Last Post: 01-18-2008, 02:41 PM
  3. New versus existing customers
    By coder in forum Search Engine Optimization Forum
    Replies: 12
    Last Post: 06-25-2005, 04:40 PM
  4. Grabbing existing value for scroll box
    By EmmaGale in forum Web Programming Discussion Forum
    Replies: 0
    Last Post: 06-17-2005, 11:25 AM
  5. Want to buy .com for my existing .co.uk Any issues here?
    By northernladuk in forum Google Discussion Forum
    Replies: 3
    Last Post: 02-03-2005, 09:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •