Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 09-03-2008, 07:23 PM Redirection
Red_X_'s Avatar
Extreme Talker

Posts: 158
Location: Houston
Trades: 0
Essentially I have a few files that if people try to directly access. http://mysite.com/thisdocument.php

if thisdocument is defined I want it to auto-redirect to the correct page.

Thanks,

X
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 09-03-2008, 07:30 PM Re: Redirection
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
In other words if they are not being used as an include file, then force them to go elsewhere?

When you include it, set some variable to true, like so:
PHP Code:
$included_file true;
include 
"path/to/file.php"
Then in the file, right at the top, like this:
PHP Code:
if(!$included_file) {
header("Location: http://my-desired-location.com/my/directory/file.php");

__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.

Last edited by wayfarer07; 09-03-2008 at 07:33 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Redirection
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41719 seconds with 12 queries