# Redirection limit error

**URL:** <https://forum.kirupa.com/t/redirection-limit-error/83837>\
**Category:** programming\
**Created:** [March 22, 2005, 3:29pm UTC](https://forum.kirupa.com/t/redirection-limit-error/83837 "2005-03-22T15:29:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![data\_switch](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@data\_switch](https://forum.kirupa.com/u/data_switch)\
**Post date:** [March 22, 2005, 3:29pm UTC](https://forum.kirupa.com/t/redirection-limit-error/83837/1 "2005-03-22T15:29:19Z")

</div>

In my PHP script, I have this piece of code:

```php

elseif($_SERVER["PHP_SELF"] != "/site/control.php") {
	header("Location: index.php");
	}

```

There are also some other if statements above it. Whenever I go to a page with this script on it, I get this error: “Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are being blocked.” Does anyone know why it is doing this? I have some other header(“Location: index.php”) lines in other if statements, but only that one gives me the error. I know because I’ve tried the script with just that statement and I still get the error. Anyone know whats going on?
