While playing with the system, you must have noticed that stories are referred to as /node/3 or /node/5 etc. This is less than optimal. In order to have URLs like /Category/The_articles_title_more_or_less, you will need to:

* Open the file [your_server]/modules/drigg/custom_url_rewrite_function.php. This file came with the drigg module.
* Select all of the text and copy it to the clipboard (all of it, from function custom_url_rewrite($op, $result, $path, $path_language=NULL) to the end of the file
* Paste it right at the end of your settings.php file, which is probably located in sites/default/settings.php
* That's it!

Reload a page, and notice that the URLs have drastically changed.
IMPORTANT NOTE: You absolutely have to save the Drigg configuration if you add more categories.

I'm curious why you chose to rewrite urls in your own custom way instead of using the path and pathauto modules?

Comments

robertdouglass’s picture

Status: Active » Fixed

Found the answer in your FAQ:

Really, and I mean _really_ neat URLs, without a single alias

Just by adding a simple function in your settings.php, you end up with _awesome_ URLs. You don't need thousands of URL aliases. While I am there, I also alias tags and users so that you can get to them through their names.
This function does this with very, very minimal load (and in fact, having such a small load does have some drawbacks).

mercmobily’s picture

Hi,

Thanks robertDouglass:-D
Having tons of urlaliases polluting the drupal DB would have also meant that changing ONE category name would have caused a problem which would be hard to manage.

Right now... well, it still causes a problem, because each node has an un=normalised category name in it (for performance reasons), but writing a function which does a mass-recalculation of the category names is trivial (and indeed important - I will add it to the TODO).

Bye!

Merc.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.