Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 06:37 pm EST

Geeklog Forums

Can I get rid of the .php in urls (and some other things)


Status: offline

graeme

Forum User
Newbie
Registered: 04/29/09
Posts: 6
hopeful
I am considering Geeklog for a news site, but I there are a few things I am not sure it can do.

The most important is getting rid of the .php bit from urls - i.e. example.com/article/123456 rather than example.com/article.php/123456

It would be easy to do the .htaccess file, but can I change the internal links Geeklog generates?

Also, is there a comment rating system? I guess not as I have not seen it on any site. I did find a rating plugin, but it did not work - is it GL 1.4 only?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
For the URLs, you would have to look into using mod_rewrite. There's isn't much (if anything) that Geeklog could do here.

You already found the Rating plugin. I haven't tried it myself, but I was under the impression that it does work with the current version.

bye, Dirk
 Quote

Status: offline

graeme

Forum User
Newbie
Registered: 04/29/09
Posts: 6
hopeful
May be I need to clarify what I need.

I can do the mod_rewrite side of it.

What about the links from, for example, the front page to individual articles?
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
You can use the rating plugin for comments, a template variable just needs to be added. The new version due out soon is much better and includes ajax support for ratings.
One of the Geeklog Core Developers.
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Why do you want to get rid of the .php? There is no need for it, as far as I know. You better get rid of /article.php/ if you want a real nice url, but there´s no need for it. Google and Google News will index your newsstories fine, I can tell you from experience.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

graeme

Forum User
Newbie
Registered: 04/29/09
Posts: 6
I think I have figured it out. It looks like I can do it in the template using story_id to build the url in the template.

It might also be possible to use a call to [template-name]->set_var somewhere to change the template variables for the link urls, but I have not yet got a grip on the plugin api to work out where and how to do this. It would be cleaner though.

@beewee,

Indexing is not my issue: it is usability, aesthetics, and permanence (i.e., keep the urls even if I switch to another cms).
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Quote by: graeme

I think I have figured it out. It looks like I can do it in the template using story_id to build the url in the template.



That's the easy part, making a link in storytext.html like {site_url}/article/{story_id}, but you also have to change the url's in the search results, new story blocks, rss feeds etc..
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

graeme

Forum User
Newbie
Registered: 04/29/09
Posts: 6
Laugh, thanks for the reply. Looking forward to the new version of the plugin - ajax will be very nice

beewee, thanks for that - and before I wasted any time trying to do it that way as well. I hope someone can suggest an easier answer - in the meantime I am reading the documentation.

 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
At least for those parts of Geeklog that are using what we (somewhat incorrectly) call url_rewrite, you could try and modify the COM_buildUrl function. For those parts of Geeklog that don't support url_rewrite (e.g. the Calendar plugin), there is no central function and you would have to change a lot of code ...

bye, Dirk
 Quote

Status: offline

graeme

Forum User
Newbie
Registered: 04/29/09
Posts: 6
Thanks,

three lines of PHP and three rewrite rules and everything I have tried, on a standard install with only the static pages and spamx plugins enabled it everything seems to work (not extensively tested though). Static pages still have urls with query strings though (not that important).

Thanks for the help.

The helpfulness of this forum is definitely a reason to use Geeklog.
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Quote by: graeme

Static pages still have urls with query strings though (not that important).


Normally, if you enable url_rewrite in the configuration, the query strings will be gone as well...
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

graeme

Forum User
Newbie
Registered: 04/29/09
Posts: 6
Sorry beewee, stupid typo on my part. It should have been "topic pages" not "static pages".
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Quote by: graeme

Sorry beewee, stupid typo on my part. It should have been "topic pages" not "static pages".



That's also a bit tricky, you can use some rewrites and change the story template, and a simple html block as a topic block, but the paging on the bottom still uses index.php?topic=topic-id&page=xx....
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

All times are EST. The time is now 06:37 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content