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. Share your own thoughts and experience, accounts may be terminated for violations.
  • Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

code to capture url

PaullasPaullas is verified member.

Acorn Moderator
Nominet Member
Nominet Registrar
Hosting Provider
Domain Marketplace
Parking Service
Joined
Jul 13, 2004
Posts
5,911
Reaction score
461
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:
Top Bottom