homepage Welcome to WebmasterWorld Guest from 54.197.215.146
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
php - check refering domain - redirect to home page how too?
???
iggy99




msg:1267966
 10:48 pm on Apr 26, 2002 (gmt 0)

hello everybody !

i have a php site and another on the same server -

our goal is to restrict acess to site #1 unless the request is coming from site #2

my public access to this site is at url: mysite.com/webShop/

my actual files are at url: dothework.com/webShop/

we want to redirect anybody attempting to access dothework.com/webShop/ to the home page mysite.com/webShop/

the sites are on the same server -

maybe some sort of refer check / redirect can be added to the header file???

many thanks for any ideas!

erv

 

jatar_k




msg:1267967
 11:16 pm on Apr 26, 2002 (gmt 0)

maybe something in the file like

$redirectPage = "public site";

if ($HTTP_REFERER != "url from other site")
{
header ("Location: $redirectPage");
}

toadhall




msg:1267968
 5:08 pm on Apr 27, 2002 (gmt 0)

Using the HTTP_REFERER variable is not 100% fool-proof as referrer logging can be turned off by the user either at the browser or through security software.

A safer route would be to use an .htaccess redirect:

[webmasterworld.com ]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved