Pretty URLs still chronically broken

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Pretty URLs still chronically broken
« on April 16th, 2013, 09:56 PM »
So I spent some time actually figuring out what the problem is, since as I've said it's *never* worked properly for me for a long time.

The rewrite filter for both boards and topics just injects the board prefix as in the DB, but while the default board seems to get the proper prefix (e.g. locally I get localhost/wedge prefixes), nothing else seems to, so everything ends up with a / prefix, e.g. /new-board-2 which obviously doesn't work properly.

Going into these boards' configuration after the event also doesn't work because the pretty URL is just listed as (localhost) / (empty box)

Storing all this directly in the DB also has other problems with respect to users who decide to move their site around, because they'll not only have URL issues to deal with for reindexing, they'll also have to cope with editing every board.

Seems to me that we might need to find some other method of dealing with this - because while it's fine on wedge.org, it's no good for most other sites.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Pretty URLs still chronically broken
« Reply #1, on April 16th, 2013, 11:48 PM »
Is it related to the word 'localhost' itself..? Maybe?
I'd recommend adding a shortcut to unwedge.com or whatever in your hosts file, and accessing your local site from that... I've never had PURLs problems with that setup.
Of course, YMMV.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Pretty URLs still chronically broken
« Reply #2, on April 17th, 2013, 12:35 AM »
No, it's not related to the fact I'm using localhost.

It doesn't show for you because you're using it in the root. Whereupon the / prefix is absolutely fine because the absolute path isn't a problem there.

But if you install it in a non-root folder, it won't work properly. Were I to install it as localhost/index.php, it would appear to work, just like it does here for the same reason it does here.

I'm not being funny but I've been reporting for YEARS that it doesn't work properly. This is why. It just finally annoyed me enough to actually spend a little time investigating.

Seriously, go install it in a non root folder for yourself and see what breaks. localhost/wedge/ will be fine. Or indeed anything that isn't the root of a domain.

nend

  • When is a theme, no longer what it was when installed?
  • Posts: 165
Re: Pretty URLs still chronically broken
« Reply #3, on April 17th, 2013, 07:38 AM »
The db system would be desirable due to topic name changes or board name changes right?

I think I trimmed most of the fat though off the storage. Originally the mod stored whole URLs which I changed to relative. Also I store more frequent hits in the cache so DB is only queried when the cache doesn't have the URL and updated as needed to minimize db usage.

It has been a while since I missed with the code on my site that uses pretty URLs so I don't remember all I did, but as I can recall allot of bugs and db waste fixed.
Re: Pretty URLs still chronically broken
« Reply #4, on April 17th, 2013, 08:25 AM »
Ok, just looked at my source code, the default db cache was the main problem in the original. I may be rambling though since your code more than likely changed.

I did cache data to the cache system, however It looks like I commented the lines out and disabled them. I am thinking it was when I was using the SQLite cache, however still some areas are faster generating a new url than relying on the default db cache. Basically saying the caching that is currently in the system by VB is just plain junk.

I would like to see how you guys are doing it and maybe lend some insight or ideas into the matter.

I think I know what you are talking about and if you remove the db caching mechanism or use relative instead of absolute that might fix the problem.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Pretty URLs still chronically broken
« Reply #5, on April 17th, 2013, 01:03 PM »
I'm not talking about any of the stuff related to caching or anything like that. I'm simply referring to the board URL as stored in the boards table, because in theory in our setup you can even do subdomain handling (like on Noisen), but right now boards are broken when they are set up.