2
I am developing a system where each user will have their subdomain according to their login but I will also allow them to configure their own domain.
As I am developing locally, I have also added some rules for everything to work on my local machine.
To solve my problem I started to make a regex in case there are no strings it does not let pass but I do not know how to allow other.
For example that list of domains:
sistema.com.br // não pode casar
local.dev // não pode casar
cliente.local.dev // tem que casar
cliente.sistema.com.br // tem que casar
app.sistema.com.br // não pode casar essa
app.local.dev // não pode casar essa
www.dominio.com.br // regex casa, já está certo
subdominio.dominio.com.br // tem que casar
dominio.com.br // regex casa, já está certo
Currently my regular expression is like this:
^(?!.*(sistema\.com\.br|local\.dev)).*$
What I need to solve is for this regex to marry any subdomains except the subdomain app
and also could not marry the main domains sistema.com.br
and local.dev
I’m not finding a solution since I still don’t know how to work with denied lists along with permitted lists.
Summarizing what I’m trying to do is marry any domain (including domains with subdomains) except the ones in the list below:
sistema.com.br
local.dev
app.sistema.com.br
app.sistema.dev
I did something similar recently and solved it this way. I pointed all domains to the same physical place and treated each domain using php I get the name of the domino that the user is accessing and give the proper treatment with my URL friendly system.
– Jasar Orion
This wouldn’t work for me. I need to solve with regular expression anyway.
– rodrigoum