Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After some trial and run i found a solution for this and i think it may help someone if i share here:</p> <p>Basically, in httpd.conf file i have written:</p> <pre><code>Alias /robots.txt D:/wampp/static-files/override-robots.txt </code></pre> <p>so this will run for each and every domain and subdomain but it can be overriden for a specific domain/subdomain which are defined in vhosts file i.e. httpd-vhosts.conf, inside the vhosts container of each domain/subdomain. So for example if i need to serve different robots.txt for www.primarydomain1.com :</p> <pre><code>&lt;VirtualHost 212.212.212.212&gt; DocumentRoot "D:/WebSites-Data/primarydomain1.com" ServerName primarydomain1.com ServerAlias www.primarydomain1.com ErrorLog "logs/primarydomain1.com-error.log" CustomLog "logs/primarydomain1.com-access.log" combined Alias /robots.txt D:/WebSites-Data/primarydomain1.com/this-robots.txt &lt;/VirtualHost&gt; </code></pre> <p>So in this way if somebody hits www.primarydomain1.com/robots.txt apache will serve robots.txt from </p> <pre><code>D:/WebSites-Data/primarydomain1.com/this-robots.txt </code></pre> <p>and for other domains/subdomains it keeps serving from:</p> <pre><code>Alias /robots.txt D:/wampp/static-files/override-robots.txt </code></pre> <p>This also leads to the fact that we can override httpd.conf some settings for a specific domain, if we define it in a vhosts container.</p> <p>The above solution is working fine for me. If there are any cons of this solution, please share with me.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload