English 中文(简体)
Htaccess/robots.txt to allow search bots to explore main domain but not directory on other domain [closed]
原标题:
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it s on-topic for Stack Overflow.

Closed 11 years ago.

Ok, I understand the Title didn t make any sense so here I ve tried to explain it in detail.

I m using a hosting that gives me space for my domain and lets me "add on" other domains on it. So lets say I have a domain A, and I add on a domain B. Basically my hosting gives me a public_html where I can put stuff that shows when someone visits website A. But, when I add the domain B, it lets me put the content of B, INSIDE of that public_html so that website B.com can also be visited by going to A.com/siteB... Thats all good, except that Google has started indexing B.com as well as A.com/siteB, I m ok with it indexing B.com, but I somehow want to prevent it from indexing A.com/siteB so that when people search for B, it doesn t end up showing A.com/siteB.

Any ideas? Let me know if the question is still unclear.

最佳回答

Just put a

User-agent: *
Disallow: /siteB

in the robots.txt in the root of your main domain. All bots that have manners will accept this, but depending on the frequency they visit your site you might have to wait a bit before the search engines update their datbases.

Additionally you could add a .htaccess with a redirect rule to /siteB/... that redirects requests that have been done using the siteA domain to http://siteB/... This will make everyone use the canonical domain even if they browse to the lesser-favored one.

问题回答

暂无回答




相关问题
hosting administration system?

i m looking for an opensource system to manage a list of web hosting clients. Services ordered payment notifications ticket support system That kind of stuff Is there anything like that? Thanks

Django, is possible to run two different versions?

I have a server on which I have two sites built with Django and Python, one site is major site is build with an older version of django, the other with the newer release, I have upgraded to the new ...

Ruby (off the Rails) Hosting

Many people have asked about Rails hosting on this site, but I m not familiar enough with the back end of things to know if there s a difference. I want to host some Ruby CGI webservices , basically ...

mobile network friendly host

i am developing an app for iphone, it is a client side application. and i found the 3g network is very slow, should I change the server host to a mobile network friendly host? any suggestions?

Strategies for Hosting 2 .NET Languages in Same Web App

I have 2 web sites (in Visual Studio - separate solutions) - one in VB.NET, one in C#. Ideally, I d like to make them both web application projects, compile each codebase into to a DLL, drop both ...

Deploying a python CGI app

I have developed a python CGI application which works just fine on my development box. My hosting provider however gives me little control of its server: I use a lot of custom stuff in my python ...

热门标签