Redirecting old static pages to new Wordpress-based CMS?

Soldato
Joined
18 Oct 2002
Posts
8,016
Hi all,

I'm busy updating a website which has a couple hundred static pages to a Wordpress-based CMS setup.

The current site has been out there for a few years, and likely has lots of in-bound links to specific pages, which when moving to Wordpress, I'd like to have automatically redirect to the new page to prevent existing incoming links from being unusable.

I've created the pages of the new site using fairly verbose slugs, which don't necessarily relate 1:1 with the existing html document filenames, so I'm not sure whether a simple htaccess rule will do the job?

Could I list the old and new in an htaccess file, or replace all the existing html documents with ones containing purely a simple redirection to the new content?
 
I'd opt for using htaccess and issuing a 301 (moved permanently) redirect e.g.:

Code:
RewriteEngine On
RewriteRule ^example\.html$ /page/example [L,R=301]
or

Code:
RewriteEngine On
Redirect 301 /example.html /page/example
I haven't used htaccess for a while (been using IIS) but that should do what you want. For the html file names which map directly to the slug (if there are any), you could go with a more generic pattern.
 
Last edited:
I use a site wide redirect to catch all traffic going to the old site and take them to the new homepage.

Above that generic rule I use specific page rules to redirect high traffic/ranking pages so that I don't lose those attributes.
 
Back
Top Bottom