Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

code to capture url

Paullas

Staff member
Joined
Jul 13, 2004
Posts
5,817
Reaction score
361
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:

The Rule #1

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

Members online

Premium Members

Latest Comments

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.
      There are no messages in the current room.
      Top Bottom