Robots.txt disallow subdomain
-
Hi all,
I have a development subdomain, which gets copied to the live domain. Because I don't want this dev domain to get crawled, I'd like to implement a robots.txt for this domain only. The problem is that I don't want this robots.txt to disallow the live domain. Is there a way to create a robots.txt for this development subdomain only?
Thanks in advance!
-
I would suggest you talk to the developers as Theo suggests to exclude visitors from your test site.
-
The copying is a manual process and I don't want any risks for the live environment. A Httphandler for robots.txt could be a solution and I'm going to discuss this with one of our developers. Other suggestions are still welcome of course!
-
Do you ftp copy one domain to the other? If this is a manual process the excluding the robots.txt that is on the test domain would be as simple as excluding it.
If you automate the copy and want code to function based on base url address then you could create a Httphandler for robots.txt that delivered a different version based on the request url host in the http request header.
-
You could use enviromental variables (for example in your env.ini or config.ini file) that are set to DEVELOPMENT, STAGING, or LIVE based on the appropriate environments the code finds itself in.
With the exact same code, your website would either be limiting IP addresses (on the development environment) or allow all IP addresses (in the live environment). With this setup you can also set different variables per environment such as the level of detail that is shown in your error reporting, connect to a testing database rather than a live one, etc.
[this was supposed to be a reply, but I accidentely clicked the wrong button. Hitting 'Delete reply' results in an error.]
-
Thanks for your quick reply, Theo. Unfortunately, this htpasswd will also get copied to the live environment, so our websites will get password protected live. Could there be any other solution for this?
-
I'm sure there is, but I'm guessing you don't want any human visitors to go to your development subdomain and view what is being done there as well? I'd suggest you either limit the visitors that have access by IP address (thereby effectively blocking out Google in one move) and/or implement a .htpasswd solution where developers can log in with their credentials to your development area (which blocks out Google as well).
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
What is better for web ranking? A domain or subdomain?
I realise that often it is better put content in a subfolder rather than a subdomain, but I have another question that I cannot seem to find the answer to. Is there any ranking benefit to having a site on a .co.uk or .com domain rather than on a subdomain? I'm guessing that the subdomain might benefit from other content on the domain it's hosted on, but are subdomains weighted down in any way in the search results?
Intermediate & Advanced SEO | | RG_SEO0 -
"noindex, follow" or "robots.txt" for thin content pages
Does anyone have any testing evidence what is better to use for pages with thin content, yet important pages to keep on a website? I am referring to content shared across multiple websites (such as e-commerce, real estate etc). Imagine a website with 300 high quality pages indexed and 5,000 thin product type pages, which are pages that would not generate relevant search traffic. Question goes: Does the interlinking value achieved by "noindex, follow" outweigh the negative of Google having to crawl all those "noindex" pages? With robots.txt one has Google's crawling focus on just the important pages that are indexed and that may give ranking a boost. Any experiments with insight to this would be great. I do get the story about "make the pages unique", "get customer reviews and comments" etc....but the above question is the important question here.
Intermediate & Advanced SEO | | khi50 -
Subdomain or folder for a section not focused on my core business
Hello there, I'm installing your analytics tool and it seems really great. I'm gonna use it for sure but I've a question that is more strategic and it's something the tool can't help me with 😛 I've a website active from 2008 and really well known in my country as a service website... we're like your "advisor" for utilities and insurances. The reason why is "savings" but really focused on utilities (broadband, gas, electricity) and check accounts or insurances. I’ve always used folders in my URLs instead of subdomains (for example www.site.com/section1 or www.site.com/section2 ). In this period I’m planning to open a new website section related to saving but not really close with what we really do in the rest of the website. This section is about coupons, vouchers and little offers. The problem is that with that section I’m going to write really a lot (a lot) of content trying to gain a lot of external links. It’s obvious that I already have a lot of contents about my core business and I’m going to write contents for original categories too. This section is anyway secondary for my business and my worry is that Google can identify me in the future as a website mainly focused on this new product. I’m really well indexed so I don’t want this decision to have any effect on my original situation. Finally the question 😛 Is it better to maintain for this section the same website structure with folders or indentify it as a subdomain to remark that it’s going to be like a totally different site with his dedicated news and all the rest? That’s why I’m evaluating a subdomain but I’m not really convinced cause subdomains can be considered as a different approach compared to original structure and of course using folder can be useful to gain root’s site rank. On the other hand, what can Google think about my core business? Thanks a lot for your help
Intermediate & Advanced SEO | | Uby850 -
SubDomain vs. SubFolder
I know this subject has been discussed many, many times before. But it is now 2013, and Google continues to tweak and change their algo to build upon the best delivered results for users. So the questions are: Does Google still treat subdomains as a completely separate and unique domain from the root? If so, is it a good SEO strategy to split up, when it fits, a website into subdomains with links pointing back to the root or main domain? As a company we have several subdomains with some of our categories. For example our main site is www.iboats.com. This site has all our boat products. But we set up subdomains several years ago for the following: boatcovers.iboats.com boatpropellers.iboats.com biminitops.iboats.com And we have our fourms as a subdomain: forums.iboats.com Splitting them out were originally done for SEO reasons, but now is more for better managing our main categories. It appears that Google is treating our subdomains as part of our main root domain anyway, so I don't see the SEO value anymore. If we were to move the subdomains into subfolders of the root, I'm wondering if we might see a boost in SEO value having more pages within the main website? I'd be interested in everyone's thoughts on this subject.
Intermediate & Advanced SEO | | tdawson090 -
Will blocking urls in robots.txt void out any backlink benefits? - I'll explain...
Ok... So I add tracking parameters to some of my social media campaigns but block those parameters via robots.txt. This helps avoid duplicate content issues (Yes, I do also have correct canonical tags added)... but my question is -- Does this cause me to miss out on any backlink magic coming my way from these articles, posts or links? Example url: www.mysite.com/subject/?tracking-info-goes-here-1234 Canonical tag is: www.mysite.com/subject/ I'm blocking anything with "?tracking-info-goes-here" via robots.txt The url with the tracking info of course IS NOT indexed in Google but IT IS indexed without the tracking parameters. What are your thoughts? Should I nix the robots.txt stuff since I already have the canonical tag in place? Do you think I'm getting the backlink "juice" from all the links with the tracking parameter? What would you do? Why? Are you sure? 🙂
Intermediate & Advanced SEO | | AubieJon0 -
Disavow Subdomain?
Hi all, I've been checking and it seems like there are only 2 options when disavowing links with Google's tool. Disavow the link: http://spam.example.com/stuff/content.htm Disavow the domain: domain: example.com What can I do if I want do disavow a subdomain? i.e. spam.site.com I'm also assuming that if I were to disavow the domain it would include all subdomains? Thanks.
Intermediate & Advanced SEO | | Carlos-R0 -
Create new subdomain or new site for new Niche Product?
We have an existing large site with strong, relevant traffic, including excellent SEO traffic. The company wants to launch a new business offering, specifically targeted at the "small business" segment. Because the "small business" customer is substantially different from the traditional "large corporation" customer, the company has decided to create a completely independent microsite for the "small business" market. Purely from a Marketing and Communications standpoint, this makes sense. From an SEO perspective, we have 2 options: Create the new "small business" microsite on a subdomain of the existing site, and benefit from the strong domain authority and trust of the existing site. Build the microsite on a separate domain with exact primary keyword match in the domain name. My sense is that option #1 is by far the better option in the short and long run. Am I correct? Thanks in advance!
Intermediate & Advanced SEO | | axelk0 -
Subdomains for niche related keywords
I wanted to know how efficient using a subdomain is, taking in consideration all the updates Google has made lately. I am looking to use a subdomain for a well branded website for a niche specific part of their website. The subdomain will end-up having more than 100 pages. I'd like to see in what cases do you guys recommend using a subdomain? How to get the same benefit out of a subdomain as i am getting from the actual main domain?
Intermediate & Advanced SEO | | CMTM0