Scenario
When having multiple websites on the account, there will be scenarios that user would want to disallow the search engine indexing on the second website.
Note: From 2020.2 onward, the Multiple Website feature is automatically enabled for all accounts. You no longer need to enable it and it is not possible to disable it. However, you may need additional site licenses to create more than one website.
Solution
Create new folders for the each website under hosting root to host the robots.txt file
- Create a text file with the name robots.txt
- Double-click to open the file
- Add the example code below
- User-agent: *
- Disallow: /
- Navigate to Commerce > Hosting > Website Hosting Files
- Click New Folder
- Folder Name: Enter Folder Name
- Example: Website B
- Click Save
- On the newly created folder: Click to open
- Click Add File
- Select robots.txt file
- Click Open to upload file
- Navigate to Commerce > Hosting > Domains
- On desired domain: Click Edit
- Web Site: Select Web Site
- Hosting Root: Select Hosting Root Example: Website B
- Click Save