• Resolved aliferste

    (@aliferste)


    Hiya,

    I am trying to set up a redirect from my blog which is at

    http://www.mysite.co.uk/blog

    to my new blog (I have transferred all my old content over)at

    http://www.anothersite.com

    Now, I still have content at http://www.mysite.co.uk which must stay intact so it is just the blog part that must be redirected. This means I cannot just put a simple redirect of the old domain to the new domain in place.
    I have been reading about 301 redirects, so created an .htaccess file with

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^mysite.co.uk/blog [nc]
    rewriterule ^(.*)$ http://www.anothersite.com/$1 [r=301,nc]

    and put it in the directory where my wordpress installation is…..the reason I am here is because obviously I have done something wrong as it….er…doesnt work !

    Any advice would be great 🙂

    Alistair

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    You’re overcomplicating it. I did the same when thinking about it. 🙂

    If these are two different servers, then it’s trivial.

    RewriteBase /blog/
    RewriteRule ^(.*)$ http://www.anothersite.com/$1 [R=301,L]

    Put this in the /blog/.htaccess file on mysite.co.uk. Done and done. Only stuff in /blog will get redirected.

    Thread Starter aliferste

    (@aliferste)

    Nope, I put the

    The site I am trying to redirect is

    http://www.theriverkelvin.co.uk/blog/

    to

    http://urbanflyfisher.com/

    I put the .htaccess file file in both the blog directory and the root directory but it does not seem to work.

    Any other ideas ?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    This definitely won’t be in the root directory, just in the blog directory’s .htaccess file.

    RewriteBase /blog/
    RewriteRule ^(.*)$ http://urbanflyfisher.com/$1 [R=301,L]

    And if doesn’t work, you have a broken host. Talk to them. It *does* work, as I use something extremely similar for other purposes.

    The RewriteBase /blog/ bit is technically unnecessary, BTW. You can remove it if you want. I usually leave it so I know what’s what, but still, it’s not strictly important.

    Thread Starter aliferste

    (@aliferste)

    Great thanks for that 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Setting up a redirect’ is closed to new replies.