Removing the word /category/ from categories URLs?!


(rea) #1

https://meta.discourse.org/category/support
https://meta.discourse.org/category/extensibility/plugin
https://meta.discourse.org/category/dev

Is it possible to make categories URLs more clean by clearing the word category from URL?

https://meta.discourse.org/category/support => Discourse Meta


Control of URL structure
(Dave McClure) #2

See also:


(rea) #3

I don’t want to rename it! I’d like to remove it completely.
Just think forum=category, then I can create something like stackexchange.com!


(Kris) #4

There’d be some issue with clashing URLs, I’d imagine - what if I had a category named Admin or FAQ?


(Mittineague) #5

It would make for “cleaner” URLs
But
Rails depends heavily on routing
so there’s no telling what would happen if you used rewriteRules or some other method to change them.

Interesting idea though I admit. I haven’t ever seen this concern brought up before.


(rea) #6

However, Is not no hope for a revolution on URLs?

@awesome​robot

what if I had a category named Admin or FAQ?

for Admin => a simple error: admin is in use. if you want to use it as a category, first click here to rename it.

for FAQ => error: please choose the type: Category / Page


(Bill Ayakatubby) #7

This would be a major technological challenge. I’m not certain it could be done without significantly rewriting parts of the core. If you want multiple forums, create multiple forums. Then each one can have its own category structure.

This would create a terrible user experience. I wouldn’t visit that forum.


(rea) #8

@Bhael​Ochon:

This would create a terrible user experience. I wouldn’t visit that forum.

Not for users | When you are creating a category, it will ask you to choose it as category. However this is not our issue. it was just a point on @awesome​robot post.


(Bill Ayakatubby) #9

My point still stands. It’s confusing for the admin who’s creating categories.

What is the issue, exactly? Why can’t you just use Discourse’s multi-site feature? Context matters.


(Neil Lalonde) #10

Reporting an error when you try to create a category named “admin” isn’t good enough. What about sites that already have a category named admin? What about when we add a new route, but haven’t been reporting an error for it? For example, if we want to add a route “/chat”, but sites already have a chat category. Having a prefix in the path to prevent complicated upgrades is what I vote for.


(Sam Saffron) #11

to add to that, you are making it impossible for plugins that add routes.


(rea) #12

What about rewriting URLs: specific rewrites for each category?!

Converting URLs in Apache is possible: .htaccess convert a url parameter in folders - Stack Overflow And: Using mod_rewrite to Convert Dynamic URLs to SEO Friendly URLs - Moz

-Is it possible for nginx, too?


(Sam Saffron) #13

this is a js app, a lot of the routing happens client side, we have duplicate routing.


(TheLoneCuber) #14

If removing “category” from the URL is not an option, what about renaming it? If the option existed to renamed from “category” to [whatever], that would help all points mentioned in this thread: SEO, visuals, and language barriers.

In many instances, including my own, the categories naturally define their distinction, so to adding “category” in-front can be like adding “website” to your domain name for extra clarity. In my instance, “categories” are countries, which clearly define themselves, but are forced to display as domainname.com/category/australia when domainname.com/country/australia is —if nothing else— at least more in-context with my content.


(Jeff Atwood) #15

About all we could do is rename it from

example.com/category/howto

to

example.com/c/howto

You’ll note that topic is similarly t


(TheLoneCuber) #16

I’d take 1 out-of-context, URL-squatting letter over 7 out-of-context, URL-squatting letters any day. The brevity, plus the uniformity [with /t/] makes sense and is a huge improvement. Any plans to move forward this: I know it’s been in some threads for some time?


(rea) #17

@TheLoneCuber

You can route URLs by rewriting in a location block. (location to simulate htaccess, since nginx uses a global config)
Read more: Module ngx_http_rewrite_module & Module ngx_http_rewrite_module


(Kane York) #18

Unfortunately, I think that will bug out the Ember router. :frowning:


(Jeff Atwood) #19

This is now the case, category is represented as /c/ in the URL.


(Jeff Atwood) #20