Forum Moderators: open

Message Too Old, No Replies

QueryStrings, ASP.NET pages, and Google

Does Google like them? Apparently not.

         

Small Website Guy

3:34 am on Aug 13, 2003 (gmt 0)

10+ Year Member



My website uses ASP.NET. Which means all the web pages end with the .aspx suffix.

I created a series of pages with urls with QueryStrings like:

www.mydomain.com/mypage?id=1
www.mydomain.com/mypage?id=2
www.mydomain.com/mypage?id=3

Google has spidered the other pages on my website, but is ignoring the above pages with QueryStrings.

I guess Google doesn't like QueryStrings. Do I have to reprogram my website if I want Google to acknowledge those pages?

-------

My second question is about links to my website using QueryStrings. If I have other websites link to me using the format:

www.mydomain.com?id=1

and then I have the server do a redirect so that the person viewing the page sees only:

www.mydomain.com

is Google going to give me popularity credit for the link?

The purpose of doing this is so my website can track who drove traffic to me, but then I don't want the user to see the ugly QueryString in his web brower's Address bar.

TheDave

3:58 am on Aug 13, 2003 (gmt 0)

10+ Year Member



Google definately indexes urls with querystrings. I have a few pages indexed with querystrings appended on the URL, the only difference between mine and yours that I can see is a trailing / before the querystring:

I use:

mydomain/?id=1

I'm not sure, or suggesting, that either way is correct, but there is definately one page that I link to like that which has been indexed. I usually specify the actual page name, rather than relying on the default document.

[edit]
I just realised I may be off the mark in my answer, when you say:

www.mydomain.com/mypage?id=1

do you actually mean

www.mydomain.com/mypage.aspx?id=1

dazzlindonna

4:07 am on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



at some point in this forum, GG mentioned not using ID in a query string. so perhaps just changing ID to some other variable would help.

keeper

4:22 am on Aug 13, 2003 (gmt 0)

10+ Year Member



I actually have the same problem.

I have an entire database of widgets that are presented with: /widget.asp?widget=2345

Google has spidered 100's of my products over the last 3 months.

Google has not indexed one widget.

1) No "id=" variables: check
2) No session ids of any kind : check
3) Googlebot successfully spidering: check

Is anyone having the same experience? Please tell me its not a .NET thang...

bilalak

8:44 am on Aug 13, 2003 (gmt 0)

10+ Year Member



.NET send a session in a cookie. Try to see the result of your request using curl.

Google index dynamic pages but it does not follow links from them I think.

pardo

10:53 am on Aug 13, 2003 (gmt 0)

10+ Year Member



keeper,

rewrite your url's from:
/widget.asp?widget=2345

into:
/widget-2345.asp or /widget-2345.html

that will certainly work and index all your widgets!

alxdean

11:44 am on Aug 13, 2003 (gmt 0)

10+ Year Member



I've been quite happy with using Querystrings, but had one page, google refusd to index and it drove me mad. could not find a pattern until 6 months later:
pages being indexed happily:
showpage.asp?pid=334&langId=1

page not being indexed
showlisting.asp?pid=334&langId=1&lid=22224

tried following
showlisting.asp?cfgid=334-1-22224
and still no luck.
validated all HTML to W3C standard and still no luck
started going on a mad cloaking trip as I thought it might be the surroundig html giving me problems and still no luck
placed the links into hidden divs at the top hoping it might be positioning of the links and still no luck. I wsa going insane!

so I played the game the other way around with
showpage.asp?pid=334&langId=1&prId=22224

then do a redirect if the querystring has a prid to the showlisting.asp and that worked great. Now google has gone from indexing 50% of my site to 90% of my site.

so querystrings work, just sometimes it can be like looking for the needle in the haystack to figure out why google follows some and not others. but if you can stay away from the "id" as identifyer do so.

ASP.NET allows you to create a similar feature many pros have been using on Apache with mod rewrite.(AT LAST!) The easiest implementation is entering code into the Global.asax under the Application_OnRender procedure to rewrite your urls. But that will only work if you 1) have full control over your server OR 2) only rewrite pages ending in aspx, as you need to change IIS settings for ASP.NET to kick in for other extensions other than aspx.

an example:

instead of:
www.mydomain.com/mypage?id=1

try
www.mydomain.com/pages/1.aspx

now catch in the application_onRender all request to aspx pages, identify if the request is to a page in the /pages/ directory and use a URLRewrite call to display the correct mypage.asp?id=1 page.
Works like a treat! and many many crawler problems are solved.

It does have an implication on PR for that particular page though, as directories tend to chop off PR being inherited from "parent" pages/dierctories, on the other hand it gives you loads of new possiblities to create dynamic keyword rich "virtual" directories if you take your time to design it right.
great implementation technique
www.mydomain/green-widgets/1.aspx
www.mydomain/blue-widgets/224.aspx

now simply catch in either a regex or using Instr "-widgets/" and resolve the pagename to an ID. and voilla you have just given google a whole bunch of new keywords to chew on even before displaying any info.

I love ASP.NET at last we VB coders can play with the big boys. ;-)

alxdean

11:47 am on Aug 13, 2003 (gmt 0)

10+ Year Member



as pardo suggested, using the widgets-123.aspx approach and catching, best with a regular expression, the widgets-xxx from the path allows you to rewrite your URL without the loss of PR associated with the inclusion of directories. Not sure which version has a better effect on keywords though. probably an answer to that kicking around somewhere on WW.

kelvinhui

12:20 pm on Aug 13, 2003 (gmt 0)

10+ Year Member



Hi Small Website Guy,

I face the same problem.

I test two kinds of link structure in the same site.
I found that some links indexed by google but some are not:

Not indexed by google
www.mydomain.com/mypage?id=1

Indexed by google
www.mydomain.com/mypage1.htm

pardo

12:22 pm on Aug 13, 2003 (gmt 0)

10+ Year Member



Not sure which version has a better effect on keywords though

alxdean,

All our pages are out of subdirectories but still losing PR. It seems to depends on the number of clicks the user have to do from the homepage in relation to inbound links. So the way of rewriting urls seems not to make any difference...

Gus_R

1:47 pm on Aug 13, 2003 (gmt 0)

10+ Year Member



Hi, I got all my asp pages indexed with QueryStrings.
Don't use "id=" expressions due googlebot avoids id traps.

keeper

11:24 pm on Aug 13, 2003 (gmt 0)

10+ Year Member



Great tips - thanks!

I was hoping to avoid the url_rewrite solution (and I thought I had, when I saw GoogleBot chowing down on all my product pages...) But 3 months is a bit long to wait for a search engine addition.

I'm going with the widget-2233.html solution - cheers. Will let you know how it goes.

Small Website Guy

1:10 am on Aug 14, 2003 (gmt 0)

10+ Year Member



I was in error in my original message, the pages look like:

www.mydomain.com/mypage.aspx?id=1
www.mydomain.com/mypage.aspx?id=2

Several people suggested getting rid of the "id" and replacing it with anything else. This sounds like the easiest thing to change. I can do that in a few minutes.

I may also experiment with the Application_BeginRequest event to see what that does.

These pages all have valid links on another page, and they are completely different pages (except they all have the same menu bar and other header stuff that repeats on every page). It's not fair that Google is ignoring them.

Small Website Guy

1:23 am on Aug 14, 2003 (gmt 0)

10+ Year Member



Wow! Application_BeginRequest really works! That's so cool. Goodbye QueryStrings, hello Google rankings.

This code works:

protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (Request.Path.EndsWith("bad.aspx"))
{
this.Context.RewritePath("good.aspx?id=1");
}
}

Assuming you have a valid page good.aspx in your root directory, the user will see a page with "bad.aspx" in his address bar, even though we REALLY know he's viewing good.aspx?id=1

BUT... does having this extra comparison at the beginning of every request hurt performance? I guess ASP.NET is doing so much other stuff, one little extra string comparison won't kill it.

alxdean

11:54 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



I have not found any performance problems yet, but then my Hosting provider f*!@ up the framework installation somewhere down the line and now the IIS is not running to the .net framework to do the errorhandling of my .aspx request but flings a standard 404 before even consulting the .net framework. Argh. hopefully they'll fix it up because if they won't I'm back to square one.

dynamic querystrings do work though. I have managed to get away with up to two in simple format, stay away from cfg and id. where pid,aid,gid,kid etc, seem to work fine.
tried to compile three into one using cfgid=1-234-568 but google did not like that one at all. still have to figure out if it was the identifyer or the dashes between the values.