I got a small site which served by Apache (I can't put Nginx in front nor change Apache to anything), and it is set up to serve the same site both over http and https (no redirects http->https is there so far, so both http and https versions are served in parallel).
What I need is to set up .htaccess
so the same URI via http and via https to serve different text file?
Like http://example.com/proto.txt
says "The site is over http" while https://example.com/proto.txt
would say "The site served over https".
RewriteRule
in your.htaccess
with a condition on it being served over https. – jcaron Nov 26 '18 at 12:45<VirtualHost>
s. So you simply need to configure a different robots.txt in one of them. Around so:RewriteRule ^/robots.txt$ /path/to/alternative/robots.txt [L]
– peterh - Reinstate Monica Dec 12 '18 at 18:08