Recent Topics

1 Apr 08, 2008 07:07    

My b2evolution Version: 1.10.x

I'd like to have URLs like "http://mysite.com/blogs/something/" for my blogs, where "something" is some unique identifier for one of them.

If there's already a good answer for my question (specifically, for the version I'm using, which is 1.10.3) in the forums, please excuse me and point me to that post. All of the posts regarding this topic that I've already read, are outdated and/or have too dirty solutions.

In the past, using version 0.9.2, I found a rather not-so-clean way to achieve this. I set up a different stub name for every blog I had, in the backoffice, and created a directory in blogs/ for each one of them. That directory contained an index.php file which was the actual stubfile. Then I created a .htaccess file in blogs/ which contained the lines:


RewriteEngine on
RewriteRule ^([^/]+)\.php(.*)$ /$1/index.php$2

For all purposes, my URLs were nice: http://mysite.com/blogs/something/ showed the blog which had "something" as stub name, the "something" directory and the "something/index.php" stub file. Also, posts' previews and internal links were working okay.

With 1.10.3, this system is a bit broken. Since the "admin" directory ceased to exist, and the admin.php file appeared in the main "blogs/" directory, now http://mysite.com/blogs/admin.php takes you to http://mysite.com/blogs/admin/, which doesn't actually exist. So, guess what? I tried a new horrible hack. I created a directory called "admin" and created a file called "index.php" into it, with the content:


<?php
include('../admin.php');
?>


(I tried using header('Location: ...') pointing to the admin.php file before, but that didn't work. It caused like a deadlock, since admin.php was redirected to admin/index.php and admin/index.php redirected to admin.php)

Anyway, the backoffice was now visible, but when I tried adding a new category to one of my blogs, an error was displayed. For some reason, index.php is involved in this so index/index.php (which didn't exist yet) was tried to be accessed. Using the same method (creating index/index.php with "include('../index.php')" into it) didn't work this time.

So now I'm looking for a better, cleaner (if possible) solution. If you have any other idea or have solved this problem in a different way, I'd be pleased to read your comment. Thank you.

2 Apr 19, 2008 23:00

Uhm... Ok. Seems no one has bothered to make URLs nicer, or my post wasn't tempting enough so as to get one answer at least.

I'd much appreciate to receive a partial response, at least. Anybody had the same problem? How did you solve it? Thank you.

3 Apr 20, 2008 00:06

Hi crazy2k,

I'd love to really give you an answer, but truth is this is standard in 2.4. So why would you (and I) bother for a hack and you are going to upgrade anyhow, tomorrow or next year.
It's not that I wouldn't want to help, it just seems so futile. I haven't got an answer, so checking out and hacking and testing would take too much time. I'd rather spend that to other questions and projects.

I am not alone with these considerations. I think 1.10 has had it's time. 2.4 is so much more fun.

Good luck

4 Apr 20, 2008 00:41

Afwas, thank you for your reply.

I understand what you say. But there must be many people still using 1.10.3, and when I first started this topic I was hoping there were many who had already faced this very same problem and had something to say about it.

5 Apr 20, 2008 01:00

in 2.x.x you can just select "absolute url" and then use htaccess to rewrite to /index.php .... *really* not sure if the same holds true for 1.10.x

¥


Form is loading...