News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

google only wap2 links

Started by sombra, September 23, 2009, 08:21:31 PM

Previous topic - Next topic

sombra

well i have notice that in google for my page theres only wap2 links its there any way i can disable this and if doing this will help me? i want people getting in to my page not that wap 2 pages if this is part of smf or sitemap mod any sugestions for seo

i have installed mod
sitemap
vbulletingmetatags
pretty url

thanks

TheDisturbedOne

You could disable them in robots.txt or in Google Webmaster if you have an account.

Kays

Quote from: TheDisturbedOne on September 23, 2009, 08:29:32 PM
You could disable them in robots.txt or in Google Webmaster if you have an account.

I don't know if that is wise since they are also compiling an index of wireless enabled sites.

What I do is to add the following in index.php just before it checks for the wireless protocols. ~line 90


if(isset($_GET['wap2']))
unset($_REQUEST['wap2']);


This allows the pages to be see normally is the browser isn't wireless. Seems to clear up the links with wap2 in them after a while also.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sombra

but theres a problem cuz google only shows wap links why? what oud be the problem i have tried hard to get my poage on google 8 months and havent got so far

Kays

I think what is happening that there is an increased effort to index wirless enabled sites. So if you got indexed with the ?wap2, like in this case by Google, other google bots will try to follow those links to find more. But I could be wrong.

The main thing is that they have found your site. After I added that I didn't notice any decrease in activity by the Google bot. And as I mentioed, The links with ?wap2 will disappear over time.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sombra

from line 87 to 91

// Unserialize the array of pretty board URLs
$context = array('pretty' => array(
'action_array' => unserialize($modSettings['pretty_action_array']),
'board_urls' => unserialize($modSettings['pretty_board_urls']),
'db_count' => 0,


here where do i need to put the code thanks

sombra

i cheked and i start to see wap from line 122 untill 154

// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
if (isset($_REQUEST['nowap']))
$_SESSION['nowap'] = true;
elseif (!isset($_SESSION['nowap']))
{
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
$_REQUEST['wap2'] = 1;
elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
$_REQUEST['imode'] = 1;
else
$_REQUEST['wap'] = 1;
}
}

if (!defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' : '')));

// Some cellphones can't handle output compression...
$modSettings['enableCompressedOutput'] = '0';
// !!! Do we want these hard coded?
$modSettings['defaultMaxMessages'] = 5;
$modSettings['defaultMaxTopics'] = 9;

// Wireless protocol header.
if (WIRELESS_PROTOCOL == 'wap')
header('Content-Type: text/vnd.wap.wml');



Kays

You can place it before either bit of code. As long as it's before that second code you posted.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sombra

did it like this chek if its fine

// Unserialize the array of pretty board URLs
$context = array('pretty' => array(
'action_array' => unserialize($modSettings['pretty_action_array']),
'board_urls' => unserialize($modSettings['pretty_board_urls']),
'db_count' => 0,
if(isset($_GET['wap2']))
   unset($_REQUEST['wap2']);
));

sombra

weel it gave me an error


Parse error: syntax error, unexpected T_IF, expecting ')' in /home/todoileg/public_html/index.php on line 92

fixed it like this

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();
// Unserialize the array of pretty board URLs
$context = array('pretty' => array(
'action_array' => unserialize($modSettings['pretty_action_array']),
'board_urls' => unserialize($modSettings['pretty_board_urls']),
'db_count' => 0,
));
if(isset($_GET['wap2']))
   unset($_REQUEST['wap2']);

sombra

ok now what is the funtion of this code?

what will happend now and how do i know if its working fine

Kays

I don't know why you would get an error since that's a copy and paste of what I use.

To test it access your forums with ?wap2 in the address (http://todoilegal.net/forum/index.php?wap2)

But it looks like it didn't work for some reason.

Can you attach your index.php to a post so I can have a look at it?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sombra

#12
ok

well i tested out and it dosent work cuz i dont have a directory forum so the url must be
http://todoilegal.net/index.php?wap2
not
http://todoilegal.net/forum/index.php?wap2
and it will get redirected to
http://todoilegal.net/forum/?wap2

Kays

It should work where you placed it. So I'm wondering that since you have Pretty URLs mod installed if that's messing it up.

One thing to try is to remove it from where it is and to place it at the begining before anything gets loaded.

Add it before: // Get everything started up...

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sombra

did that already but i keep seeing the same things

sombra

i dont know but ihave looked at google and i have like 100 pages from google and 98 pages are wap2 theres got to be somthing wrong i have read some people complaining about the same thing there got to be a trick for getting the real pages indexed and not the wap2 pages cuz if someone enters a wap2 page they cant go anyware else from that page i think its a big problem

king001001

first you need to make a back up of "INDEX.PHP"

Step 1:


open "INDEX.PHP",then find and remove the following code

// Determine if this is using WAP
, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
if (isset($_REQUEST['nowap']))
$_SESSION['nowap'] = true;
elseif (!isset($_SESSION['nowap']))
{
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
$_REQUEST['wap2'] = 1;
elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
$_REQUEST['imode'] = 1;
else
$_REQUEST['wap'] = 1;
}
}

if (!defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' : '')));


Step 2:

now paste this code

if (!defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['index.php']) || isset($_REQUEST['index.php']) || isset($_REQUEST['index.php']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['index.php']) ? 'wap' : (isset($_REQUEST['index.php']) ? 'wap2' : (isset($_REQUEST['index.php']) ? 'imode' : '')));



it will works 100% fine

Kays

I think it's the Pretty URls mod which is the problem.

Try king001001's suggestion. If that doesn't work for you, please ask in the support topic for that mod and see if the mod's author can be of assistance.

Either way, let us know how it's going.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sombra

but doing this what im doing and what will happend

i will ask on pretty url to see what they say to me


and thanks for the help and replys

Kays

Honestly, I don't think it will make a difference.

My suggestion is not to use pretty urls. From what I understand, they really don't help and do cause some things not to work properly. Also, once you start using them, you need to continue since all of the links will be formated with the pretty urls.

My suggestion is not to use it. Since the disadvanages seem to outweight any advantages it "might" offer you.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: