Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

code to capture url

Joined
Jul 13, 2004
Posts
5,852
Reaction score
387
Hi

I know i have asked for this a few year back but i lost the code so apologies for asking again.

I am looking for some php code that will grab the url from the browser then allow me to forward that url to somewhere else

for example

domain.co.uk - lands on site

then forwards to mysite.co.uk/<domainname>

then when i park say 100 domains on the mysite.co.uk it automatically forwards the domains on.

thanks in advance.

Paul
 
Coding this in the comment box but maybe something along the lines of:

You will also want to parse the url string to prevent attacks which ive not added or just use php's built in functions

Code:
<?php

$location = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI]";

header("Location: $location");

or use a specific location to redirect the user

header("Location: targetsite.co.uk");

?>

This will also pass the URI and any parameters that are appended to the url... for example: https://google.co.uk?source=acorn&name=secnam
 
Last edited:

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom