Forum Moderators: phranque

Message Too Old, No Replies

old school method of redirecting from a subdomain?

         

cavemanlawyer15

2:17 am on Apr 22, 2008 (gmt 0)

10+ Year Member



I moved my Wordpress blog and am having redirect issues.

The blog used to be on [blog.domain.com....] I want it on [domain.com...]

So... I moved all the files, and now have confirmed that all my new posts are going in the right place. Problem is, all those backlinks are not redirecting properly.

I'm not having any luck teaching myself how to deal with this directly via the Wordpress dashboard, so I am perfectly happy to create a long-winded entry in .htaccess which will list every single post's old location, followed by its new location. This is not hard to do, just some cut and paste work.

BUT the changes don't seem to be taking effect. I'm wondering if they have been made in the right place or not. Questions:

1) Would these redirect entries be made in the core site's .htaccess file, or perhaps in the subdomain where the blog used to reside?
2) Do I need to unmap the folder which used to be the subdomain, and/or remove the folder all together?
3) Is there any risk or tradeoff in listing ~100 lines of redirects?

Thank you all for your wisdom.

jdMorgan

1:47 pm on Apr 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the folder that used to contain the old blog subdomain is not named "/blog" then this is easy.
In that folder's .htaccess file, place the single line

Redirect 301 / http://www.example.com/blog/

That will redirect all requests for resources in that directory to the same-named resources in the example.com/blog directory. You don't need 100 lines.

You can then delete all the other files from this folder -- but only after testing to be sure the redirect works!

If the old blog subdomain folder *was* named "/blog" then the code is more complicated, but you can still probably do it (depends on the server configuration).

Jim