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?
search engine un-friendly urls
Moderator: General Moderators
- julian_lp
- Forum Contributor
- Posts: 121
- Joined: Sun Jul 09, 2006 1:00 am
- Location: la plata - argentina
Great, I was thinking in do something like that, but I dont know how can I acces to GET variables this way.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
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, '/')How can I get the arguments in an url like the one you posted?
Code: Select all
if (isset($_SERVER['PATH_INFO'])) {
$path_info = trim($_SERVER['PATH_INFO'], '/');
}- julian_lp
- Forum Contributor
- Posts: 121
- Joined: Sun Jul 09, 2006 1:00 am
- Location: la plata - argentina
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
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK