Page 1 of 1
search engine un-friendly urls
Posted: Wed Aug 02, 2006 1:53 am
by julian_lp
I'm unsure whether this topic belongs to "theory and Design", so feel free to ask me for moving it
I've written a project in which I used a lot of messy urls in order to pass different kinds of arguments
For instance, this kind of links are used all around my app
http://MYSITE/index.php?qw=1&z=3&ui=3&o ... 1a30f701fb
Even though it works fine, I realised it's *very* search engine unfriendly.
The bad news are that the shared server on which it runs (apache), has mod_rewrite disabled.
What should I do in order to make the app more friendly to search engines ? What do you think?
Posted: Wed Aug 02, 2006 2:13 am
by Luke
you don't have to use mod_rewrite... you can do page.php/var1/var2/var3/var4 but you would need to map those to their respective variable names
Posted: Wed Aug 02, 2006 2:20 am
by julian_lp
The Ninja Space Goat wrote:you don't have to use mod_rewrite... you can do page.php/var1/var2/var3/var4 but you would need to map those to their respective variable names
Great, I was thinking in do something like that, but I dont know how can I acces to GET variables this way.
I mean, this would be easy
index.php?onlyonearg=bla/bla1/bla2/bla3, and then, do the following
pseudo code
Code: Select all
$args= $GET['onlyonearg'];
$splitargs= split($args, '/')
But I would still be using "?", so It would seem as unfriendly (a little bit less) as my former url
How can I get the arguments in an url like the one you posted?
Posted: Wed Aug 02, 2006 2:25 am
by Luke
Code: Select all
if (isset($_SERVER['PATH_INFO'])) {
$path_info = trim($_SERVER['PATH_INFO'], '/');
}
Posted: Wed Aug 02, 2006 2:45 am
by julian_lp
The Ninja Space Goat wrote:Code: Select all
if (isset($_SERVER['PATH_INFO'])) {
$path_info = trim($_SERVER['PATH_INFO'], '/');
}
mmm, nice trick. Althoug url's made this way, could be seen as "malformed"
I found an article wich seems to explain quite well this topic. If anyone is interested, give it a read.
http://www.sitepoint.com/article/search ... endly-urls
In the other hand, I wonder if there is some time penalties using this method, given that apache tries to find a couple of pages before redirects to index.php
Posted: Wed Aug 02, 2006 5:29 am
by Ollie Saunders
So, what’s the problem with that? Well, most search engines (with a few exceptions - namely Google) will not index any pages that have a question mark or other character (like an ampersand or equals sign) in the URL.
No wonder Google is where it is.