Skip to main content

Documentation: Domain per Language plugin

A robots.txt per domain

A robots.txt file tells search engines what they may crawl and where your sitemap is. A Joomla site has one robots.txt, and that one file can only name one sitemap and one set of rules. That is a problem as soon as your languages live on different domains.

Domain per Language gives every domain its own robots.txt, straight from the plugin.

Filling it in

Every domain row has a robots.txt field. It already contains what is in Joomla's own robots.txt.dist, so you can add to it instead of writing it from scratch. Add the sitemap of that domain yourself:

User-agent: *
Disallow: /administrator/
Disallow: /tmp/

Sitemap: https://www.example.nl/sitemap.xml

Leave the field empty if you want Joomla to handle robots.txt for that domain the normal way.

What a crawler gets

When someone asks for /robots.txt on a domain you configured, the plugin answers with exactly what you typed, as plain text. Nothing is added and nothing is filled in for you. What you see in the field is what a crawler gets.

Two things have to be true

  • There is no robots.txt file in the main folder of your site. If that file exists, your web server hands it over itself and Joomla never sees the request. A fresh Joomla comes with robots.txt.dist, not robots.txt, so this is usually fine. If a file is there, the plugin warns you on its settings screen. Rename it or delete it.
  • Your server has to send unknown addresses to Joomla. The .htaccess that comes with Joomla does this already. A normal nginx setup with try_files $uri $uri/ /index.php?$args does too.

Checking the result

Open https://www.example.nl/robots.txt and https://www.example.com/robots.txt in your browser. Each one should show its own text. The domain health check does the same test for you and says so when a domain shows something other than what you filled in.