I want to build a site where any link to my domain such as domain.com/fefeg or domain.com/rfggtg the (/xxxxx) part will be randomly generated, always redirects to another domain.
Basically, any link with my domain + /xxxxx or even /xxx/xxx, will forward to another domain of my choosing such as otherdomain.com/x/index.php or whatever.
Godaddy has a forwarding option but doesnt forward if there is more to the link other than the plain domain name
How can i make this on my plain server? Is there a simple one file script to be uploaded to server that does this?
If you're using Apache web server yes as commenter already mentioned, you need to adjust the .htaccess file to something like this:
This should redirect for every url in the domain with a 302 temporary redirect http response to the client.