basically I'd like to have my page accessible by only certain listed users which we'll make a unique code.

for example user A will be able to access with an URL like:


but when someone accessed with only www.mysite.com we'll direct to a "you don't have access" page.

of course if user A sent their unique link to other people, others will be able to access, but that's ok for my page.

the reason is that when User A access this page, we'd want to show a "Welcome to the page User A" text, and we'll retrieve this creds from the link.

can we use PHP for this? any kind of help is appreciated. thank you in advanced :)

1 Answer 1


You can just check if query string "u" exists, else redirect to your "you don't have access" page.

So something like this:

if ( isset($_GET('u')) ) {
else {
    header('Location: https://domain.com/no-access/');
  • thank you! this works! Commented Aug 17, 2021 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.