Closed Bug 855475 Opened 12 years ago Closed 12 years ago

Ability to serve static pages with a URL at the root

Categories

(Webtools Graveyard :: Air Mozilla, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peterbe, Assigned: peterbe)

References

Details

At the moment, all static pages are served under "/pages/". So if the page has a URL of "/about" the full URL actually becomes "/pages/about". We want to be able to use "/about". This means that it's going to compete with the slugs for events. I suggest we simply make it so that a static page is not allowed to match an event slug. Or any old event slug too for that matter. All old URLs under /pages/* will and must continue to work too.
So this turned out to be a bit bigger change than I had thought but I'm pretty pleased with the outcome. Now, you can basically go to any event or any static page simply by hitting it on the root level. E.g. "/my-event-slug/" or "/my-static-page/" The "old" static pages URL prefix will continue to work as is. I.e. "/pages/my-static-page/" isn't going anywhere. Now, regarding clashes. IF there is a static page that has the same URL as a slug of an event, then the event gets "first pick". Also, suppose you have an old replaced slug that clashes with the URL of a static page, the redirect from the old slug to the new event slug gets first pick. Look at this screenshot: http://cl.ly/NsvZ Notice how I have 3 URLs in there. The 1st and the 3rd link to "/I-can-change-things" and "/unique-page" respectively. However, for the 2nd link, it goes to "/pages/super-awesomeness" instead. And, as you can see, you can see which event slug it clashes with. Now lastly, to prevent clashes I've made it so that if you try to add an event with a slug (or title that gets converted to a slug) that would clash with a static page, it'll raise a validation error on the form. Yes, events are "more important" than static pages, but if the static page is in use, it would be bad to replace it. This checking is only applicable to new events where the slug is automatically generated and if you try to edit the slug of existing events. Please have a play and mark the bug as verified if it works.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee: nobody → peterbe
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.