0

I have 2 different sites setup using website code on apache2. Now I need to have 2 different robots.txt files for each domain. This is first vhost file

<VirtualHost *:80>
    ServerAdmin admin@domain.com
    DocumentRoot /home/ajith/projects/m234/codepool/

    <Directory /home/ajith/projects/m234/codepool>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ServerName dev.m234-one.com
    SetEnv MAGE_RUN_CODE onew
    SetEnv MAGE_RUN_TYPE website

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

This one is the second one

<VirtualHost *:80>
    ServerAdmin admin@domain.com
    DocumentRoot /home/ajith/projects/m234/codepool/

    <Directory /home/ajith/projects/m234/codepool>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ServerName dev.m234-two.com
    SetEnv MAGE_RUN_CODE twow
    SetEnv MAGE_RUN_TYPE website

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Does anyone know how can I configure htaccess so that, I can use

m234-one.com/robots.txt Url and display robots file at /home/ajith/projects/m234/codepool/pub/robots/one/robots.txt

and use

m234-two.com/robots.txt URL to display robots file at /home/ajith/projects/m234/codepool/pub/robots/two/robots.txt

Thanks/ Ajith

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.