Jump to content

header() redirection VS SEO


robert_gsfame

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • 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.