Need help with server administration?
RSS icon Email icon Home icon
  • .htaccess redirect from static site to Wordpress

    Posted on May 26th, 2009 servbit1 No comments

    I’m trying to redirect pages from an old static site to new pages in WordPress. So, for example,

    http://www.mysite.com/contact.htm

    should redirect to:

    http://www.mysite.com/contact

    I’m using the following in the .htaccess file, but it’s not working:

    redirect 301 /mysite/contact.htm http://www.mysite.com/contact

    I ended up figuring this out myself and implemented as a series of rewrites along the lines of:

    RewriteCond %{HTTP_HOST} ^jeffthomascobb.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.jeffthomascobb.com$
    RewriteRule ^contact\.htm$ “http\:\/\/www\.jeffthomascobb\.com\/contact\/” [R=301,L]

    etc.

    Works fine now

    Leave a reply

    You must be logged in to post a comment.