Skip to main content
Commonmark migration
Source Link

###Help with Redirections

Help with Redirections

###Help with Redirections

Help with Redirections

Capitalized the title, removed the "How do I...", reformatted the question so that it uses numbered bullets correctly
Source Link
MikeSchinkel
  • 37.5k
  • 14
  • 116
  • 132

How do I create these Creating 301 redirectsRedirects for Post, Page, Category and Image URLs?

Help###Help with Redirections

  1. To move Wordpress from the subdirectory to the root:

    /wp/(.*) => /$1

    
    /wp/(.*) => /$1
    
  2. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

    /products-directory/(.*) => /products-top-level-page

    /about-directory/(.*) => /about-top-level-page

    /services-directory/(.*) => /services-top-level-page

    
    /products-directory/(.*) => /products-top-level-page  
    
    /about-directory/(.*) => /about-top-level-page  
    
    /services-directory/(.*) => /services-top-level-page  
    
  3. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories:
    e, e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with `.html html`, this will work, I believe:

    
    /same-word(.*) => /newcategory/$1
    

    /same How would I create the rule if I don't have permalinks ending in `.html`? (I think I saw ! is the "not" character, but not sure how to use here -word- is it):

    
    /same-word(.*) => /newcategory/$1!\.html
    
  4. And then, once I have the specific pages identified and redirected as above, I'll be deleting all the rest (garbage) and want to send users to the home page (or maybe a random post?).*

    So, 2 questions here:

    1. How do I create the rule that says "for everything except the files already redirected as above, do this"

    2. How would I stop that rule from applying to new pages and posts I create from now on?

    One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do?

    As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) => /newcategory-- it has virtually no ranking or external /$1 back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

  5. Also, should I move existing images etc. into the wp-content directory or leave them in their existing sub-directory/ies? My inclination is to really go for a 'clean-sweep' - get rid of everything that seems untidy, but I'm not sure if this would be more work than it's worth…

How would I create the rule if I don't have permalinks ending in .html? (I think I saw ! is the "not" character, but not sure how to use here -- is it:

/same-word(.*) => /newcategory/$1!\.html

?)

  1. And then, once I have the specific pages identified and redirected as above, I'll be deleting all the rest (garbage) and want to send users to the home page (or maybe a random post?).

So, 2 questions here:
i. How do I create the rule that says "for everything except the files already redirected as above, do this" ii. How would I stop that rule from applying to new pages and posts I create from now on?

One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do?

As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

  1. Also, should I move existing images etc. into the wp-content directory or leave them in their existing sub-directory/ies? My inclination is to really go for a 'clean-sweep' - get rid of everything that seems untidy, but I'm not sure if this would be more work than it's worth...

How do I create these 301 redirects?

Help with Redirections

  1. To move Wordpress from the subdirectory to the root:

    /wp/(.*) => /$1

  2. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

    /products-directory/(.*) => /products-top-level-page

    /about-directory/(.*) => /about-top-level-page

    /services-directory/(.*) => /services-top-level-page

  3. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories:
    e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with .html , this will work, I believe:

    /same-word(.*) => /newcategory/$1

How would I create the rule if I don't have permalinks ending in .html? (I think I saw ! is the "not" character, but not sure how to use here -- is it:

/same-word(.*) => /newcategory/$1!\.html

?)

  1. And then, once I have the specific pages identified and redirected as above, I'll be deleting all the rest (garbage) and want to send users to the home page (or maybe a random post?).

So, 2 questions here:
i. How do I create the rule that says "for everything except the files already redirected as above, do this" ii. How would I stop that rule from applying to new pages and posts I create from now on?

One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do?

As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

  1. Also, should I move existing images etc. into the wp-content directory or leave them in their existing sub-directory/ies? My inclination is to really go for a 'clean-sweep' - get rid of everything that seems untidy, but I'm not sure if this would be more work than it's worth...

Creating 301 Redirects for Post, Page, Category and Image URLs?

###Help with Redirections

  1. To move Wordpress from the subdirectory to the root:

    
    /wp/(.*) => /$1
    
  2. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

    
    /products-directory/(.*) => /products-top-level-page  
    
    /about-directory/(.*) => /about-top-level-page  
    
    /services-directory/(.*) => /services-top-level-page  
    
  3. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories, e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with `.html`, this will work, I believe:

    
    /same-word(.*) => /newcategory/$1
    

    How would I create the rule if I don't have permalinks ending in `.html`? (I think I saw ! is the "not" character, but not sure how to use here -- is it):

    
    /same-word(.*) => /newcategory/$1!\.html
    
  4. And then, once I have the specific pages identified and redirected as above, I'll be deleting all the rest (garbage) and want to send users to the home page (or maybe a random post?).

    So, 2 questions here:

    1. How do I create the rule that says "for everything except the files already redirected as above, do this"

    2. How would I stop that rule from applying to new pages and posts I create from now on?

    One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do?

    As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

  5. Also, should I move existing images etc. into the wp-content directory or leave them in their existing sub-directory/ies? My inclination is to really go for a 'clean-sweep' - get rid of everything that seems untidy, but I'm not sure if this would be more work than it's worth…
added 56 characters in body
Source Link
CJN
CJN
  1. To move Wordpress from the subdirectory to the root:

    To move Wordpress from the subdirectory to the root:

    /wp/(.*) => /$1

  2. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

    /products-directory/(.*) => /products-top-level-page

    /about-directory/(.*) => /about-top-level-page

    /services-directory/(.*) => /services-top-level-page

  3. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories:
    e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with .html , this will work, I believe:

    /same-word(.*) => /newcategory/$1

/wp/(.*) => How would I create the rule if I don't have permalinks ending in /$1

  1. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

/products-directory/(.) => /products-top-level-page /about-directory/(.) =>html? /about-top-level-page /services-directory/(.*) =>I think I saw /services-top! is the "not" character, but not sure how to use here -level-page is it:

  1. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories: e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with .html , this will work, I believe:
/same-word(.*) => /newcategory/$1!\.html

/same-word(.) => /newcategory/$1 How would I create the rule if I don't have permalinks ending in .html? (I think I saw ! is the "not" character, but not sure how to use here -- is it: /same-word(.) => /newcategory/$1!.html
?)

So, 2 questions here: 
i. How do I create the rule that says "for everything except the files already redirected as above, do this" ii. How would I stop that rule from applying to new pages and posts I create from now on?

One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do? As

As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

  1. To move Wordpress from the subdirectory to the root:

/wp/(.*) => /$1

  1. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

/products-directory/(.) => /products-top-level-page /about-directory/(.) => /about-top-level-page /services-directory/(.*) => /services-top-level-page

  1. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories: e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with .html , this will work, I believe:

/same-word(.) => /newcategory/$1 How would I create the rule if I don't have permalinks ending in .html? (I think I saw ! is the "not" character, but not sure how to use here -- is it: /same-word(.) => /newcategory/$1!.html
?)

So, 2 questions here: i. How do I create the rule that says "for everything except the files already redirected as above, do this" ii. How would I stop that rule from applying to new pages and posts I create from now on?

One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do? As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

  1. To move Wordpress from the subdirectory to the root:

    /wp/(.*) => /$1

  2. For all pages currently within subdirectories in the root, I want to delete and/or combine a bunch of pages into one top level page:

    /products-directory/(.*) => /products-top-level-page

    /about-directory/(.*) => /about-top-level-page

    /services-directory/(.*) => /services-top-level-page

  3. For a bunch of top-level pages matching a specific pattern, I want to direct them into specific categories:
    e.g. the file names all start with the same two words like this: same-word-variation-variation.html and I want them to keep their existing file names -- if I set my permalinks to end with .html , this will work, I believe:

    /same-word(.*) => /newcategory/$1

How would I create the rule if I don't have permalinks ending in .html? (I think I saw ! is the "not" character, but not sure how to use here -- is it:

/same-word(.*) => /newcategory/$1!\.html

?)

So, 2 questions here: 
i. How do I create the rule that says "for everything except the files already redirected as above, do this" ii. How would I stop that rule from applying to new pages and posts I create from now on?

One idea is that by deleting, I'd be getting a 404 page not found, so I should create the rule for the 404 page itself? Is that what I want to do?

As I've said, the site has been badly developed (with the client instructing people to just "throw up a page" with no regard for proper architecture, SEO, etc.) -- it has virtually no ranking or external / back links to worry about, but I want to understand the best approach from an SEO and proper development perspective.

Source Link
CJN
CJN
Loading