On Jun 12, 8:07 am, bingo <[EMAIL PROTECTED]> wrote:
> hi AD,
>
> I thought of doing so, but somehow I am not feeling comfortable with
> finding articles by title. Its much easier and efficient (I believe)
> to find articles by id as they are integers as compared to title which
> will require text search. Is there a way to use some redirect kind of
> facility.
No matter what solution you do, you cannot avoid that you need to be
able to find an article by title, or find the article id which
corresponds to the title to do what you are asking. I see no point in
using a 3rd party service, or hosting another service on your own
server to translate /look-arnt-i-pretty to /2, when the time and
hassle to do that would be more than just handling it in your own
code. If you were going to put such a service on your own server that
would mean that user goes to url /a/url, a service rewrites that to /
another/url, mod_rewrite then rewrites that to index.php?/another/url
and cake then checks that against your routes definitions to figure
out what to do with it. That's at least 1 too many steps imo, and the
only way that the first step can work is if it.... looks in a db/
lookup table which seems to be what you are trying to avoid, but
infact just moving the logic to somewhere else (?).
Have a look at the slug behavior on the bakery.
Perhaps I put too much weight in the words "text search" but finding a
unique string value in a table will be marginally slower than finding
an integer, but only marginally. All a db does in such cases it looks
in the index (or sorts the table and then looks there if you don't
have an index - which of course you will want) and look up the first
value that matches.
Alternatively, you can make your links of the form /$id/$title, and if
the title in the url doesn't match the title of the article perform a
redirect to the correct url - but in that case you may be loading each
article twice.
>
> I think it will help to briefly explain the context. Is it true that
> search engines give higher ranking to websites that have more
> meaningful url ? If this is not true than I don't need to worry about.
Yes allegedly they do, because if your url contains "Investigating
Ontologies for Simulation Modeling" it is supposed that that page will
be about those (key) words rather than 'just' being a page that
contains them.
>
> PS: I am not sure what do you mean by title bar. I looked at the
> webpage title, and tab title and both have right spelling.
Go here http://findnwrite.com/memento/. I see "Mememnto - Mozilla
Firefox"
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---