Page 1 of 1

links in the form index.php?page=text&var

Posted: Wed Apr 12, 2006 8:35 am
by rsmarsha
Do links such as index.php?page=text&&var=variable effect the way a search engines ranks pages?

I'm only asking as someone i know has had a company who optimises search rankings, tell them that links such as the one above need to be changed. Not sure if they are going to do it via mod rewrite or another method.

If such links do effect a ranking, then mod rewrite would solve this right?

Thanks in advance for any advice.

Re: links in the form index.php?page=text&var

Posted: Wed Apr 12, 2006 8:47 am
by Roja
rsmarsha wrote:Do links such as index.php?page=text&&var=variable effect the way a search engines ranks pages?
"A search engine" makes the question a little hard to answer, so let me nitpick a little.

http://searchenginewatch.com/reports/ar ... hp/2156431

Yahoo, Google, MSN, and AOL account for over 90% of searches. So lets focus on them. All four have in the last few years revamped their search algorithm to not be negatively affected by dynamic variables in the url.

I can't make any statements about the other 10%, but for the four major search engines, dynamic urls do NOT hurt your rating anymore. (Each of the four did have that issue at some point in the past, but have resolved that problem).

Posted: Wed Apr 12, 2006 9:08 am
by rsmarsha
Thanks for the info. No need to change the links then.

Do you know a good place to look into mod_rewrite? As i havn't used it yet, and could use that to hide dynamic links, for security as well as anything.

Posted: Wed Apr 12, 2006 10:31 am
by sheila
From Google's guidelines http://www.google.com/webmasters/guidelines.html
If you decide to use dynamic pages (i.e., the URL contains a "?" character), be aware that not every search engine spider crawls dynamic pages as well as static pages. It helps to keep the parameters short and the number of them few.
and
Don't use "&id=" as a parameter in your URLs, as we don't include these pages in our index.
I have no idea why they have a problem with 'id'.

Posted: Wed Apr 12, 2006 11:18 am
by ntbd
If you want to tidy them up you can save the following into a .htaccess file that must be saved in the root of your website (with index.php).

Code: Select all

RewriteEngine on 
RewriteRule ^pages/([A-Za-z0-9]+)\/?(([A-Za-z0-9]+))?$ index.php?file=$1&var=$3
Then yoursite.com/pages/pagename/options or yoursite.com/pages/pagename will go to index.php?file=pagename&var=options

Posted: Wed Apr 12, 2006 12:41 pm
by ntbd
Sorry, example not very clear. See it in action on my website pintprice.com where every country apears to have its own folder, and then an html page showing the same data in every currency:

http://www.pintprice.com/region/Iraq will show you the price, then go to aud.htm to see the price in Australian Dollars, etc - all using the above syntax.[/url]

Posted: Thu Apr 13, 2006 6:18 am
by rsmarsha
Yeah i've looked at using mod_rewrite, what happens if sometimes you have 2 vars in the link and sometimes more than that?

Posted: Thu Apr 13, 2006 7:04 am
by Oren
Check this out: http://www.webcredible.co.uk/user-frien ... arks.shtml

Note that this is true for September 2004 and I assume that things have changed - I guess that this subject needs some more serious research.

Posted: Thu Apr 13, 2006 8:13 am
by ntbd
If you dont know how many vars you might end up using you could use pharse_str() in your PHP to treat one var as multiple vars, or just adjust the regex above to suit.

As far as I know know Google doesn't mind ?pageId=etc type urls, but its a lot nicer looking like this and more intutive if visiters want to guess a URL.

Posted: Thu Apr 13, 2006 8:44 am
by Oren
ntbd wrote:As far as I know know Google doesn't mind ?pageId=etc type urls, but its a lot nicer looking like this and more intutive if visiters want to guess a URL.
For the first part ("Google doesn't mind ?pageId="...) - I'm not sure, see sheila's second quote. With the second part ("but its a lot nicer looking"...) I totally agree with you.