I want to issue a redirect to a new randomly generated subdomain name for every request I get. Below you can find my vhost configuration. I want to do a redirect towards a subdomain containing some random alphanumeric string in . It's ok if it is something as basic as the datetime+ip of a client or something like that, I just need to do some fingerprinting, it doesn't have to be more complex. Is there a way I can generate that via some script and plug it into the vhost for every request, an existing file with available options of random strings or some kind of regex?
<VirtualHost *:443>
ServerName mysite.com
Redirect 302 / https://<randomstring>.mysite.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/site.cert
SSLCertificateKeyFile /etc/apache2/ssl/site.key
</VirtualHost>
My OS is ubuntu 20.04