I need to develop a javascript code that is not working.
My need is as follows:
When the user accesses a certain page, I would like to supplement the URL with some parameters, eg:
If the domain is xxx.com.br/index.php, redirect it to xxx.com.br/index.php&variavel=1
Remembering that it can also enter a subdirectory, for example:
xxx.com.br/pasta/index.php, you should also add xxx.com.br/pasta/index.php&variavel=1
Basically, if the domain coicidir, it adds a variable at the end.
Important detail, I did this and it was looped, because when redirecting it it identifies the domain in the same way, so if the domain hits, it must have another check to see if the parameter does not already exist in the URL. p>