views:

117

answers:

1

Background: I've got a web app on sub.domain.com. My primary website is on domain.com. My sub.domain.com pages are stuffed with keywords that I would like to use to get upped in pagerank on domain.com. however, the whole app has been written on sub.domain.com, and it'll be some effort to host it at domain.com/subdirectory, due to how URLs are written, etc.

First question: would you expect that migration (from sub.domain.com to domain.com/subdirectory) to substantially improve the pagerank of domain.com over how it is now? I've done a lot of research, and opinions are split on if google with link the subdomain with the main domain.

Next question: if I do want to do the migration, it'll be difficult to do in the actual codebase (more tedious than difficult). Does anybody have some advice for how I could do this with mod_rewrite? I know there has to be a clever way to do it, but I can't even start to sketch out a solution. Maybe this means it's not a good thing to do, but I was hoping for kind of a quick hack, rather than rewriting all my URLs. Plus, I would like it to be pretty easily reversible, which wouldn't be the case if I change my URLs (dev is ongoing, so it's not as simple as just rolling out a previous version).

+2  A: 
  1. Pagerank isn't a property of domains, it's a property of individual documents. So it'd be more accurate to say that migration from sub.domain.com to domain.com/subdirectory will improve the pagerank of domain.com/subdirectory. If you're concerned solely about the ranking of the domain.com home page, the impact on that will mostly depend on your internal linking. For example, if all pages on sub.domain.com currently have a "home" navigation link that leads to the home page of sub.domain.com, and when you do your move they'll now lead to the home page of domain.com, then this will contribute to the domain.com home page's ranking. If this "home" navigation link went to domain.com/subdirectory, on the other hand, then that's what they'll be contributing pagerank to.

  2. mod_rewrite doesn't change the outbound links in your HTML, it changes how inbound links are interpreted. So it would let you put this in the virtual host file or .htaccess for sub.domain.com:

    RewriteEngine on
    RedirectRule (.*) http://domain.com/subdirectory/$1 [R=301]

    to mass redirect any requests coming in on sub.domain.com where they need to go. It won't help you produce correct new-form URLs in your codebase. (You could, in theory, leave all your links how they are and rely on the 301 redirect to keep you from having to change them, but this is really sloppy and wasteful, generating two HTTP requests instead of one for no good reason).

chaos