301 redirecting large list of pages

6 replies
  • WEB DESIGN
  • |
I am trying to rebuild a site that was poorly built on joomla onto a wordpress site. I have about a thousand pages that need redirected. They are all in the format listed in this example.

Redirecting them this way is working but is there a way to redirect all city pages to the new format with one code?
Would redirecting about a thousand pages separately in the .htaccess file cause problems?

Any help would be appreciated.

Code:
redirectmatch 301 /Auburn-floodcleanup-waterdamage-floodrestoration-removal-Alabama.html /locations/alabama/auburn/
redirectmatch 301 /Birmingham-floodcleanup-waterdamage-floodrestoration-removal-Alabama.html /locations/alabama/birmingham/
redirectmatch 301 /Anchorage-floodcleanup-waterdamage-floodrestoration-removal-Alaska.html /locations/alaska/anchorage/

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>
# END WordPress
#301 #large #list #pages #redirecting
  • Profile picture of the author jeffreysloe
    I just finished a conversion from a standard HTML site to a WordPress site. I too had lots of pages with many ranked well in the SERPs. I didn't want to lose any of the page rankings, so I was in search of the best way to 301 redirect all html (www.mysite.com/about.html) pages to the new "text only" pages (www.mysite.com/about).

    After doing my research, I found out that there was no way to redirect the entire page because most of the pages were in the public_html directory, not in subdirectories. So, instead of cluttering up the .htaccess file, I decided to search the WP plugins to see if there was one that could meet my needs. That's when I came across Redirection, by John Godley. I was able to setup page for page redirection. Even though it took a lot of extra work, it was well worth it. Here's a link to learn more about the plugin, WordPress Page/Post 301 Redirect - How To 301 Redirect

    From memory, I think the number of redirects in the .htaccess is unlimited, but everything I read, it was not recommended, but don't quote me on this.
    Signature

    I have been on the Internet since 1999. I'm here to share what I have learned about online marketing, web design and SEO strategies.

    {{ DiscussionBoard.errors[9928847].message }}
    • Profile picture of the author hotrod26
      Thank you very much.

      I am not sure what the advantages are to using a plugin. Not sure if it just makes it easier or what.
      {{ DiscussionBoard.errors[9930077].message }}
      • Profile picture of the author jeffreysloe
        Originally Posted by hotrod26 View Post

        Thank you very much.

        I am not sure what the advantages are to using a plugin. Not sure if it just makes it easier or what.
        Rodney,

        The plugin is not for ease-of-use. You still have to add the "source URL" and "Target URL" for each page. One of the best features is its ability to capture a log of 404 errors. You can then redirect those URLs accordingly.

        After all of the new pages have been indexed by the webcrawlers, which some say may take up to 6 months, you could deactivate or remove the plugin.

        Read about the features and advantages here: https://wordpress.org/plugins/redirection/
        Signature

        I have been on the Internet since 1999. I'm here to share what I have learned about online marketing, web design and SEO strategies.

        {{ DiscussionBoard.errors[9930195].message }}
        • Profile picture of the author hotrod26
          ok, I see Jeffery.
          Thank you very much.
          {{ DiscussionBoard.errors[9930877].message }}
  • Profile picture of the author UMS
    Depending on your URL structure of the old site, you can do something like (untested):


    RedirectRule ^/([a-z]+)-.*-([a-z]+).html /locations/$2/$1 [NC] [R]
    {{ DiscussionBoard.errors[9932017].message }}
    • Profile picture of the author hotrod26
      Thank you Peter.
      I have not been able to get it working yet but it has pointed me in the right direction (I think)

      If I put the code as is I get a 500 server error.

      If I put redirectmatch 301 /([a-z]+)-.*-([a-z]+).html /locations/$2/$1 it redirects all of those pages to /locations. I have yet to get the /$2/$1 to work.
      So it seems the ([a-z]+)-.*-([a-z]+) is working to redirect all the pages.

      If I put the RedirectRule ^ at the beginning or the [NC] [R] at the end I get the 500 error.

      Well, thanks again
      {{ DiscussionBoard.errors[9933061].message }}

Trending Topics