Google juice with subdomains and porting an application using rewrite rules


Google juice with subdomains and porting an application using rewrite rules



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).




.htaccess passing domain name

1:



Mod-Rewrite for large sites…how much is too much?
  1. Pagerank isn't a property of domains, it's a property of individual documents.


    Mod Rewrite with Joomla
    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.


    htaccess redirect problem
    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.


    301 Htaccess Redirect Rule
    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.


    301 Redirect Rule
    If this "home" navigation link went to domain.com/subdirectory, on the other hand, then that's what they'll be contributing pagerank to..
    mod rewrite everything but one request_uri
  2. mod_rewrite doesn't change the outbound links in your HTML, it changes how inbound links are interpreted.


    Mod_rewrite Question
    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)..



72 out of 100 based on 72 user ratings 222 reviews

@