Wildcard subdomain for WordPress
I would like to add a cool little function for my website. In nutshell there is https://domain.com and I want everyone could access from any subdomain. So like https://yourname.domain.com basically any random text and numbers they could figure out, without registration. And if you access the site from there I could grab that name with PHP and write a custom message. I don’t have registration on my site and I don’t want that at all, but it would be fun if they could change that string in the text.
I have read many posts here, and the official WordPress documentation, and based on that we set up the hosting side for https://*.domain.com so that must work, but after I tried https://randomname.domain.com on my site I got an error like:
It not seems Worpress related at all. But on my localhost I’ve played last night and there from yourname.localhost always redirected to simpla localhost so I can’t get the string from url, so I had to force it to make statis so I could develop the feature. If I removed the index.php and just used a custom one then this redirection not happened. So I think WordPress have much role of rooting these things. And offcourse SSL not gonna help in this case also I guess.
As I told I’ve read a lot but every different user want to solve different problem, some want to redirect for their webshop, some want registered users to apper there, so I’m confused what is the ideal solution for me. Do I need multisite enabled also? But I don’t want multiste I just want people can access my site with https://yournam.domain.com/ and if they give the direct link to other menu then https://yourname.domain.com/menu and I really need thats to remain in the adress bar so I can gather the info for my script.
Anyone did something similar? Anyone can suggest how could I solve this?