Forum Moderators: open
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.
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
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...
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. ;-)
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...
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.
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.
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.
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.