Is there any way to redirect a URL by having 1 centeral redirect page like:

```
example.com/redirect

```

and having a sort of attribute at the end to redirect to a certain page,

```
example.com/redirect?pagename

```

and in the code it will tell the webpage to redirect to the desired page.
Sorry if I baffled or anything I'm quite new to this sorta stuff.