SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member musiclover's Avatar
    Join Date
    Aug 2004
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation How To 301 Redirect Wordpress Posts To New Link Structure Using .htaccess?

    Hello! there,

    I have a wordpress blog setup the following way using permalinks feature:

    http://www.mydomain.com/blog-post.html
    http://www.mydomain.com/blog-post-2.html
    http://www.mydomain.com/blog-post-3.html

    and I've now decided to add the following structure:

    http://www.mydomain.com/read/blog-post.html
    http://www.mydomain.com/read/blog-post-2.html
    http://www.mydomain.com/read/blog-post-3.html

    So how do I 301 redirect all the old links to new structure using htaccess?

    I've tried many methods while doing a research on Google but still haven't found the solution. So anyone here to help me with the problem?

    Thanks!!

  2. #2
    SitePoint Zealot Dogs and things's Avatar
    Join Date
    Jun 2007
    Location
    Spain
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YouŽll need to write a separate line for every page you want to redicrect using the following:
    Code:
    redirect 301 /blog-post.html http://www.mydomain.com/read/blog-post.html
    redirect 301 /blog-post-2.html http://www.mydomain.com/read/blog-post-2.htmll
    And so on.
    Spanish site on dog behaviour and education and a foro de perros.
    *Not so recently reconstructed but functioning pretty nicely*


Bookmarks

Posting Permissions

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