Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red

Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)