optimization - mod_rewrite - which hosting account to redirect to? -


  • let's have 2 domains www.mydomain.com , www.mydomain.co.uk

  • our main site on www.mydomain.com

  • we have separate hosting account, on same server, www.mydomain.co.uk - have .htaccess file redirects mydomain.com

    [code] rewriteengine on rewritecond %{http_host} ^([^.:]+\.)*mydomain\.co.uk\.?(:[0-9]*)?$ [nc] rewriterule ^(.*)$ http://www.mydomain.com/?referrer=mydomain.co.uk [r=301,l] [/code] 
  • we have set blog, on www.mydomain.com/blog/

problem: want subdomain: http://blog.mydomain.co.uk forward http://www.mydomain.com/blog/ "blog.mydomain.co.uk" more popular (as exists on google blog).

solution: can either direct "blog.mydomain.co.uk" subdomain "mydomain.co.uk", , set .htaccess on .co.uk hosting account redirect (301) mydomain.com/blog/

or

we can direct "blog.mydomain.co.uk" subdomain "mydomain.com" , set .htaccess on sire redirect above.

just wondering choose? there difference between above, in terms of search engine optimisation? what's 'better' way of doing it?

you shouldn't paying 2 accounts; can have multiple domains pointing same server space, , handle rewrites there. best thing seo choose 1 primary domain , stick it; way don't spread web hits across multiple domains.

neither of solutions seem right answer. you're not using mod_rewrite it's power; you're doing redirects (not internal rewrites), since 301, , provide full url (which implies redirect, not rewrite). there's no need two-stage redirect describe. redirect directly blog.mydomain.co.uk virtual host mydomain.com/blog/, in 1 step.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -