robert_gsfame Posted July 20, 2012 Share Posted July 20, 2012 I got my website let say www.abc.com and for mobile version m.abc.com so i use php script to detect if the browser was running from mobile or pc device then redirect it to each of them. my question is that if this will affect the SEO? I mean i don't want the mobile one to be crawled. thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/ Share on other sites More sharing options...
xyph Posted July 20, 2012 Share Posted July 20, 2012 If you don't want the mobile one to be crawled, use a robots.txt file (google for more info). A legit crawler should never identify itself as a mobile browser, so if you've set up your redirection properly, there shouldn't be an issue. I'm not an SEO expert though. Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363059 Share on other sites More sharing options...
DavidAM Posted July 20, 2012 Share Posted July 20, 2012 I sometimes wonder about robots.txt. Sure, the "legit" crawlers will use it, but the "il-legit" crawlers can use it to find out about sections of your site that may not be linked. I'm still on the fence about it in general. It would not surprise me if the major search engines have (or will build) search sites specifically for mobile pages. In which case, you may or may not want them indexed. I think in this case, I would use the same test on the pages of the mobile site as is used on the non-mobile site. Then redirect (301: permanently moved) the user back to the main site if the user agent is not mobile. Just be sure to use the exact same test so you don't create an infinite loop. Most bots, I suspect, either don't bother to set the user-agent, or clone something from one of the major browsers, so a check on the mobile site should get rid of them. Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363135 Share on other sites More sharing options...
xyph Posted July 20, 2012 Share Posted July 20, 2012 Why would you care about illegit robots? You can't really do much to stop them. Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363147 Share on other sites More sharing options...
redarrow Posted July 20, 2012 Share Posted July 20, 2012 are you using hdml and xhtml? Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363163 Share on other sites More sharing options...
DavidAM Posted July 20, 2012 Share Posted July 20, 2012 Why would you care about illegit robots? You can't really do much to stop them. True. But if you have, let's say, an "admin" folder on your site, and it isn't linked anywhere, on your site, you would think that it is safe from bots. But some blackhats, seeing "admin" in a robots.txt file, may take it as a challenge to attempt to hack your admin section, and you have told them there is a directory by that name as a starting point for their attempt. Of course, in this scenario, there is no reason to list the admin folder in the robots.txt file, since there would never be any links to it anywhere, the robots would never know to look for it. On the other hand, noobs may see the robots.txt as a security measure which it is not and naively list the admin folder. Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363168 Share on other sites More sharing options...
redarrow Posted July 20, 2012 Share Posted July 20, 2012 Why would you care about illegit robots? You can't really do much to stop them. True. But if you have, let's say, an "admin" folder on your site, and it isn't linked anywhere, on your site, you would think that it is safe from bots. But some blackhats, seeing "admin" in a robots.txt file, may take it as a challenge to attempt to hack your admin section, and you have told them there is a directory by that name as a starting point for their attempt. Of course, in this scenario, there is no reason to list the admin folder in the robots.txt file, since there would never be any links to it anywhere, the robots would never know to look for it. On the other hand, noobs may see the robots.txt as a security measure which it is not and naively list the admin folder. you put a index.php in the folder encase anybody looks in there, or use a mod rewrte rule. Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363169 Share on other sites More sharing options...
redarrow Posted July 20, 2012 Share Posted July 20, 2012 slap this in the admin folder. .htaccess AuthUserFile /home/username/safe/.htpasswd AuthGroupFile /dev/null AuthName EnterPassword AuthType Basic Require valid-user Quote Link to comment https://forums.phpfreaks.com/topic/266000-header-redirection-vs-seo/#findComment-1363170 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.