Hello.
I m trying to understand what is the best way to build my links..
Any Help ???
So far i m building my links this way...
For my HomePage... http://localhost/index.php?p=homebody
For the categories...http://localhost/index.php?p=display&cid=1
and for the items....
http://localhost/index.php?p=display&ci ... =EuroDance VINYL AristName ArtistSong
What you think???
Search Engines Friendly links...
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Those would be consider non-search engine friendly links is what I think 
However, most search engines now do spider those links, I am still in the boat that believes dynamic-looking links still rank lower than static-looking links.
http://www.domain.com/articleid/10
http://www.domainc.com/index.php?articleid=10
The first is what would be considered a "clean" url the latter is what is considered a non search friendly URL
However, most search engines now do spider those links, I am still in the boat that believes dynamic-looking links still rank lower than static-looking links.
http://www.domain.com/articleid/10
http://www.domainc.com/index.php?articleid=10
The first is what would be considered a "clean" url the latter is what is considered a non search friendly URL
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Remember that the only interface is not just the GUI (the page). The URL is actually part of the interface too and making it friendlier for end users makes your overall apllication easier to use. Users can make educated guesses on how to modify the variables in the URL. Users will feel more comfortable changing what looks like a path, compared with changing something with a load of ? & = in it.
EDIT | For some research points look at mod_rewrite and the Front Controller design pattern with a request router.
EDIT | For some research points look at mod_rewrite and the Front Controller design pattern with a request router.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Thnx....
mod_rewrite takes a URL like http://localhost/foo/bar/x/y and transparently turns it into the correct form http://localhost?foo=bar&x=y for example. You define those rules. If you have hard-coded links into your application which point to the & ? = form of the URL then you'll have to recode all those to be friendly links. It's good practise to "build" all URLs in your application with a function you create, such as create_url($path). For example rather than hard-coding:NTGr wrote:Thnx..
IF i uderstand correctly i sould use mode_rewrite to RECREATE the LINKS ....RIGHT???
This will effect the way my pages work?? since cid & pid are values used by several functions
Thnx again....
Code: Select all
<a href="?module=checkout&action=confirm&order=1234">Confirm your order</a>Code: Select all
<a href="<?php echo create_url("/checkout/confirm?order=1234") ?>">Confirm your order</a>mod_rewrite can be used to play a fairly minor part in friendly URLs. If you can set up mod_rewrite to simply prepend index.php/ then you get URIs like /some/friendly/url mapped to something like:
/index.php/some/friendly/url
You can then break that down in your own code and work out where to direct the request. Using the approach allows you to change your routing rules without changing your web server configuration. Any helper functions for building friendly URLs in your application can now be a bit more flexible/dynamic too.