Update: I've been through many pages of Google and I FINALLY found it! Here is the code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/%1 [L,R=302]
However, files are no longer accessible. So random.example.com does go to...
I have hosting set up on a wildcard on my domain (*.example.com) and I would like to have the following type of redirect:
whatever-the-user-types-here.example.com > example.com/whatever-the-user-types-here
Does anyone know the code for this please? This would make my day if someone could help...
I am looking for a peice of code that I can add to my .htaccess file which will do the following:
Redirect example.com/articles/whatever-the-user-types to example.com/whatever-the-user-types
Can someone help me with this or guide me in the right direction please?
Thanks.