Forum Moderators: coopster

Message Too Old, No Replies

Exclude URL from redirect?

         

Scoty

10:13 pm on Dec 4, 2007 (gmt 0)

10+ Year Member



Hi

Does anyone know how to exclude a url from a redirect in an index.php file?

I'm guessing it would be something like:

$goto = "http://www.website.com/catalog";
header("HTTP/1.0 301 Moved Permanently");
header ("Location: $goto");

exlude ("http:bbs.website.com)

PHP_Chimp

11:45 pm on Dec 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How are people accessing this link?
As
$goto = "http://www.website.com/catalog";
header("HTTP/1.0 301 Moved Permanently");
header ("Location: $goto");

Makes me think that you are using the index.php page to redirect to the /catalog page. If this is the case then people will not see a link to any other pages as the redirection will have already taken place.

If there is a link to another site then there is no way for you to stop that link getting redirected, unless you want to check the return headers for that link before you let people access it. You can use CURL to look at the link then depending on the status of that link decide what you want to do about it.

<edit>
Sorry didnt notice this was your first post.
So welcome along :)

[edited by: PHP_Chimp at 11:46 pm (utc) on Dec. 4, 2007]