saltcod
saltcod

Reputation: 2031

Simple mobile redirect giving error — This webpage has a redirect loop

I'm trying to do a simple mobile redirect on my site, but I'm getting the error in the title.

The redirect code is simply:

<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "http://bartlettstudio.com/mobile";
}
//-->
</script>

If you visit http://bartlettstudio.com on a phone, you can see that the redirect is indeed working and taking you to http://bartlettstudio.com/mobile, but that /mobile page isn't loading. It will hang and eventually time out and give you the error above.

I assume this is a server/dns setting of some kind, but I don't even know where to look.

Thanks for any suggestions!

Terry

Upvotes: 0

Views: 343

Answers (1)

user47589
user47589

Reputation:

Your script is redirecting the page back to itself. So the question is, why are you redirecting to the mobile page from the mobile page? Need to remove the code from the /mobile page or put something in place to keep it from activating.

Upvotes: 1

Related Questions