Jump to content

Mobile Redirection


Guest NicoleMurruni
 Share

Recommended Posts

Guest NicoleMurruni

When trying to view our website from a mobile phone or an iPad, it redirects to another website which does not exist. I can see where the redirection is taking place in the index.php file, but I do not know what I need to remove in order for the redirect to stop. From a mobile device or iPad it should just go to our normal website, www.u-a-s.com, we do not have a mobile version as of yet. I tried a few things, but do not know enough to know what to take out. Can anyone help?

 

Here is the code:

************************

$ua = $_SERVER['HTTP_USER_AGENT'];

if (

stristr($ua, "Windows CE") or

stristr($ua, "AvantGo") or

stristr($ua,"Mazingo") or

stristr($ua, "Mobile") or

stristr($ua, "T68") or

stristr($ua,"Syncalot") or

stristr($ua, "Blazer") ) {

$DEVICE_TYPE = "MOBILE";

}

if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE") {

header ("Location:http://lahori.org/mydev/universal/mobile/");

exit;

}

define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */

require('./wp-blog-header.php');

?>

Link to comment
Share on other sites

Guest NicoleMurruni

No need to be rude. No I do not know php very well, I am not that dumb though. I tried to remove the website that does not exist and it still says too many redirects when trying to load on the phone. Our web guy up and left, and left us basically stranded. Doing the best I can with what I know but this is one thing I have not been able to fix no matter what I do. I even tried replacing the website that does not exist with the good one, and that still says too many redirects.

Link to comment
Share on other sites

I'm not being rude, it was a serious question. This forum is for help with code YOU wrote. 

 

if (

stristr($ua, "Windows CE") or

stristr($ua, "AvantGo") or

stristr($ua,"Mazingo") or

stristr($ua, "Mobile") or

stristr($ua, "T68") or

stristr($ua,"Syncalot") or

stristr($ua, "Blazer") ) {

$DEVICE_TYPE = "MOBILE";

}

if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE") {

header ("Location:http://lahori.org/mydev/universal/mobile/");

exit;

}

?>

 

Remove all of that. 

 

If you tried that already, you should have said so in your original post. 

Link to comment
Share on other sites

Guest NicoleMurruni

I really appreciate you trying to help. Unfortunately I did not write the code, and the person who did took our money and left us completely. I removed everything as you said and then when I tried to access the website on a pc nothing, it did not come up. Any ideas?

Link to comment
Share on other sites

Nicole,

 

if you're still subscribed this (and haven for bid haven't solved this already), "header" is the re-direct function in PHP that is causing the problem more than likely. it's a built-in resource. Jessica? one comment and this would have been over. what's up? how was your day? Nicole, hopefully this answers the question and sends you on your marry way. By the way, PHP, like all other languages is incredibly complex and you have to do your own organization of the documentation material or you'll spend hours trying to sort through it all.

 

Don't worry about that (I just wanted to mention this to you). Heck, I talked to a professor at a 4-year school today and HE even said that academic scholars can't even figure out a way to do it!! I hope that helps. It's not a tough problem and obviously deserves a one-liner answer. Might be a good idea for you to start learning the sites that help with this stuff. start with:

 

www.php.net

 

everything you could possibly want to know is there.

Edited by help_me_with_php
Link to comment
Share on other sites

"header" is the re-direct function in PHP

 

No it is not. If you look at the manual entry for header you will note that it is used to send HTTP headers to the client. Sure, one or more of these *headers* are then responsible for forcing the client to be redirected, but saying that the header function is the "re-direct" function is not correct.

Link to comment
Share on other sites

No it is not. If you look at the manual entry for header you will note that it is used to send HTTP headers to the client. Sure, one or more of these *headers* are then responsible for forcing the client to be redirected, but saying that the header function is the "re-direct" function is not correct.

 

trq,

 

I wish I had the funding to hire you. Based on what I've seen and your site, sems like you can curb the stuff that creeps in and produce great stuff. Is that not correct?

 

by the way, the OP wouldn't understand anything about what you said. Sure I could research it and say the same thing, but why make someone feel bad? That's not a way to create bridges with people. ;)

Link to comment
Share on other sites

I assume lahori.org was the developer(s) hired, at least it would seem that way from the site on said address.

 

Disregarding their horrible site, which should serve as a warning to not hire those guys/that guy, you might want to take Jessica's advice. Hire someone who really knows what they're doing, and have them go over the custom code added by the previous coder.

If you removed the code pointed out by Jessica, uploaded the changes, and didn't see any change. Then there must be some other redirect hidden in the system somewhere. A search for the string "Location:" should reveal it. Remember to look closely at the surrounding code though, as should be quite a few legitimate uses of a header redirect in WP as well.

Edited by Christian F.
Link to comment
Share on other sites

I don't blame you, and you didn't miss out on anything (valuable). Maybe a quick laugh, or a groan, but.. :P

Only reason I went there, was because I'm confident in my securing of the browser; Nothing gets shown without my express permission. ;)

 

Also, after about 15 years of moderating/administrating a lot of different fora, channels and whatnot, I've seen just about anything. (Unfortunately.) So, yeah, I'm not surprised.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.