Is sub-domain better or sub-folder? - seo

I have a classifieds site and I want to know whether creating subdomains or sub-folders is better, as I am in state of confusion.
If we need to take sub-domains then what are the benefits which we can get from sub-domains?
If we need to take sub-folders then what are the benefits we can get from them?
If we create sub-domains then Google considers sub-domains as individual domains and would show only 2 results per page.
So please clear my doubts and let me know which one is better.

Search engines will treat subdomains more like separate domains, so it many cases using sub-folders is the way to go, so that you are not spreading yourself to thin.
using both is a bad idea, as search engines will try to index both, and one will get flagged as duplicate content.
Here's an article from SEOMoz explaining it in more detail:
http://www.seomoz.org/blog/understanding-root-domains-subdomains-vs-subfolders-microsites

Personally, I go off the logic that a subdomain is a different application / site owned by the same company. A subfolder is part of the same application / site.
It is probably better for your PageRank / search engine listings if you have 'one-big-site', rather than lots of different loosely coupled domains. If the content of the sites is distinctly different, e.g. a personal site might have a gallery or blog subdomain which keeps the content distinctly seperate from the main site - then it probably makes sense for a subdomain, otherwise, I'd stick with folders.
p.s. Side note, dunno if this is important, but web-browsers only open two connections at once to a website when downloading the different files that constitute a page. So there is a reason for a subdomain in this instance where it actively speeds up (though, on a fast site, minimally) the page load time.

It depends on what content you want to create subfolder/-domains for.
Is it related to your original site? Then you should definitely use sub-folder as this belongs to the same domain. It's much better for the link juice to spread if you use sub folders.
As for the PageRank, it's better to use subfolders.
Subdomains is considered as a new site. Subfolders is not, and will get better rankings if your original site is powerful.
You can use both subdomains and subfolders if you like, but don't forget to use the canonical-tag to avoid duplicate content.
Two relevant links that explains this further:
http://www.searchmarketingstandard.com/when-to-use-subdomains-vs-subfolders
http://www.searchenginejournal.com/subdomains-or-subfolders-which-are-better-for-seo/6849/

Why not both? Have demandb.com/foo and foo.demandb.com go to the same place.

Technically, a subdomain is a different server. The company I work for has a domain with several subdomains where every subdomain is located on a different (virtual or real) computer/server. That way, if one of them crashes, the rest just keeps running.
From a developer's perspective, a subdomain would force everything within the subdomain to be a different application while in a subfolder, the subfolder and subsubfolders could be part of the application in the root folder. When I create web applications, those web applications are often tested first on a test server in a subfolder. Once they make it through the tests, they are moved to the root of their own subdomain.
When two subfolders are related to one another, they're often part of the same application, thus it would be better to keep them in their own subfolder so they can share cookies and sessions more easily.

2 comments:
Use sub folders if you need SSL- then you only need 1 basic certificate for the root
If you use both, make sure you redirect 301 one to the other. That will avoid the search engine duplication issue, but would still be problematic for SSL in certain situations.

If your site can be easily partitioned by the subdomains and each subdomain can operate independently then do it! You can then easily scale out your application by deploying different servers(or clusters) for each subdomain.
Examples:
Craigslist: by region(seattle.craigslist.org, sfbay.craigslist.org, etc)
Livejournal: by community/user
Technically, you can do this with folders, but it requires a web proxy farm, whereas subdomains can be done with simple DNS entries.

its also depends on your needs whether u want separate login system for sub domains, because it wont be possible is you are using sub-folder. Sub-folder share same session.
For sub domains you have to set shared cookie for all domains.

Related

How to point different domains to the same site

I've found myself in a situation where I have to use different domains for the same site.
It's a multilingual website that uses the path for the language so I have something like:
mysite.com/en
mysite.com/es
mysite.com/fr
mysite.com/ru
What I need is something like
mysite.com/en
misitio.es/es
monsite.fr/fr
bladimir.ru/ru
It's an Apache server. We enabled domain aliases and if I enter misitio.es the server redirects the web browser to mysite.com/es but showing misitio.es in the url.
What I would need is each domain to work on their own, not redirecting me, sharing all the content and source code. There should be no differences neither in files or in the database, and the htaccess should be configured to redirect each language (/es, /en, /fr, /ru) to its respective domain (*It's the last thing to do, we have not changed thw htaccess file yet).
I've found this guide for multisites in drupal, but it explains how to build a multisite from zero and my website is already in production, also, I'm not sure on how does it apply to my specific problem.
Is it possible to achieve what I need?
Any advice would be helpful.

Strange domains in mod_pagespeed cache folder

About a year ago I have installed mod_pagespeed on my VPS server, set it up and left it running. Recently I was exploring files on my server, went to pagespeed cache folder and discovered some strange folders.
All folders usually named this way ,2Fwww.mydomain.com or ,2F111.111.111.111 for IP addresses. I was surprised to see some domains that does not belong to me, like:
24x7-allrequestsallowed.com
allrequestsallowed.com
m.odnoklassniki.ru
www.fbi.gov
www.securitylab.ru
It looks like something dodgy is going on, was my server compromised, is there any reasonable explanation?
That does look peculiar. Everything in the cache folder should be files that mod_pagespeed tried to rewrite. There are two ways that I know of that this can happen:
1) You reference some third-party resource (say an image from another domain, or google analytics script) and you have explicitly enabled rewriting of that domain with ModPagespeedDomain www.example.com or ModPagespeedDomain *.
2) If your server accepts HTTP requests with invalid Host headers. Try (for example) wget --header="Host: www.fbi.gov" www.yourdomain.com/foo/bar.html. If your server accepts requests like that it may be providing mod_pagespeed with an incorrect base domain, and then subresources would be fetched from the same domain (so if www.yourdomain.com/foo/bar.html references some.jpeg, and your server accepts invalid host headers, we could fetch www.fbi.gov/foo/some.jpeg as the resource). There was a recent security release that makes sure all of these subrequests are done against localhost (not arbitrary third-party websites). Please see: https://developers.google.com/speed/docs/mod_pagespeed/CVE-2012-4001
You might want to look through these folders and see what specific resources are in there. I think that the biggest concern you should have is that someone might be trying to perform an XSS attack on your users or maybe a DDoS attack against another website (like www.fbi.gov), using your server as one vector. I do not think that these folders are indicative that your server itself is compromised.
If you would like to discuss this more, https://groups.google.com/forum/?fromgroups#!forum/mod-pagespeed-discuss is a good list to join and email.

CPanel: How to use two different domains in one hosting account, keeping url?

Right now there's two different accounts, with both domains having each their own hosting account,
for similar website (let's say domain.fr and domain.co.uk)!
I've merged the two websites into one (currently hosted as 0.0.0.0/site/language ),
making it multilanguage! The script just need a prefix on root,
such as like www.domain.com/english/ or www.domain.com/french.
This works as expected, if only a domain is used, but I would like to use two different domains (domain.fr / domain.co.uk).
So, I want to catch the current request URL, to know what language to display. What's important is that, the request urls keep persistent.
For example,
http://domain.co.uk/language_english
http://domain.co.uk/language_english/somepage.php
http://domain.co.uk/language_english/somedirectory/someotherpage.php
While,
http://domain.fr/language_french
http://domain.fr/language_french/somepage.php
http://domain.fr/language_french/somedirectory/someotherpage.php
This two domains are actuall hosted in same hosting account, let's said
127.0.0.1/language_variable/somepage.php
Any suggestions or good practices?
If I got your question , It's a feature in Web Hosting's solution which is called Addon Domains and depend on hosting company that how many Addon Domain they let you to put into one account !

1 domain two separate applications

http://www.one.com
and
http://www.one.com/uk
www.one.com is the main site, but there is a UK version of this site which ideally needs to be in a subdirectory (/uk).
How do set IIS up to allow me to have multiple sites under one domain?
Or can I have two separate sites and use ISAPI_rewrite to point www.one.com/uk to read from another site but keep the url www.one.com/uk?
Could you not just setup a virtual directory that points at the second application? Assuming you are using asp.net, you'd have to make sure there was no overlap in the web.config files (you may have to remove/add some elements) but a virtual directory would be a simple solution I'd think.
You could just set up a virtual directory called "uk" inside the main site for "www.one.com", and place the UK version of the application inside it. You'll need to make sure that the application inside it either uses relative links (to make sure it does not stray out into the main application), or it's absolute links include the /uk/ prefix.
Alternatively, have you considered using two hostnames? E.g., www.one.com for global/ US/ non-UK, and uk.one.com for the UK site?
Just setup a virtual "/uk" directory. http://support.microsoft.com/kb/172138
You can do it with ISAPI_Rewrite with the proxy if you needed to use multiple domains but I would recommend if you had to use multiple domains doing it the easy way by making the second site : uk.one.com using host headers. http://www.visualwin.com/host-header/
Alternatively you could set up subdomain like uk.one.com and redirect user there if he is from uk. It's easier.

How to hide distributed servers under a single domain?

I currently host my company's website and blog on separate servers, reached by separate domain names - www.example.com and www.example.net. This is so I can give blog server access to our partners without compromising security on our main server. However, our SEO guy is now demanding that the blog be put on our main server, as www.example.com/blog.
I would like to maintain the current server separation rather than putting both on the same server. Is there any good way to keep them separated, but have them both under a single domain name? A subdomain would also be acceptable (blog.example.com).
My main website server is a Debian box running Apache 2, and I have full root access to it. The blog server is run by Hostgator, and I have limited access.
Edit: Thanks, all. In this particular situation I don't particularly want to transfer the blog again, and I don't have easy access to the DNS records, so i went with mod_proxy and it worked like a charm. I wish I could give you all "preferred answer" status, though, because all of your information was awesome.
A subdomain would be easy: just create an A record in DNS which maps blog.example.com to the IP address of the blog server, and have another A record in DNS which maps www.example.com to the main website server (this latter record probably already exists).
Would the SEO guy be happy with blog.example.com? It's not the same from an SEO perspective, but it might be good enough for him. I work at a company where SEO is at least 1/3 of what we do, and that's our setup: blog.example.com and www.example.com.
You could try to get fancy and proxy requests to /blog to the 2nd server, if you insist on keeping the blog off your box, but I think you can find a secure way to share space. Proxying like that could get annoying, and it basically doubles the latency to your blog.
Give the blog guys an account on your box; don't give them root/special privileges. If you can get away with it, don't even give them SSH access -- just give them a FTP login (make sure they can't access /var/www), and maybe a mysql account or something. (As you can see, this all depends on how much control/power the blog folks demand.)
Then, just make a symlink to the blog root, so they can write to a restricted area like /home/blog/www and still have it included in the website:
ln -s ~blog/www /var/www/blog
If a subdomain is for some reason not a possible way for you to go, you could use Apache's mod_proxy module to proxy requests to /blog to your second server.