Hello,
The users on my DIscourse forum are showing once in the Users list in the settings menu. However, each user has a duplicate url, for example:
How do I remove the redundant URL?
Duplicate User URLs
The discussion revolves around LegacyTheTeam noticing that each user on their Discourse forum has a duplicate URL, differing only by case (e.g., https://forum.legacy-events.com/u/hadi and https://forum.legacy-events.com/u/Hadi). LegacyTheTeam wants to remove the redundant URL but is unsure how.
Arkshine explains that the username in the URL is case-insensitive, and this behavior is expected. LegacyTheTeam clarifies that they don’t need case sensitivity, but rather want to delete one of the duplicate URLs.
Merefield asks for clarification on where the duplicate URLs are appearing, and Jagster questions whether case-insensitive URLs should result in multiple URLs.
Pfaffman explains that there are many URLs for each user, one for each case of each letter, and that it’s not possible to delete them. He suggests that instead, the URLs could redirect to the desired case.
Firepup650 provides examples of how to implement case-insensitive URLs using regex in JavaScript.
Hello,
The users on my DIscourse forum are showing once in the Users list in the settings menu. However, each user has a duplicate url, for example:
How do I remove the redundant URL?
Hello, welcome back. ![]()
I believe this is the expected behavior. The username in this URL is not case-sensitive.
Here on meta LegacyTheTeam, legacytheteam or LeGacYTheTeAm will redirect to LegacyTheTeam.
I can’t be wrong, but I don’t think there is a setting for that. ![]()
Would you mind sharing why you want to require usernames to be case-sensitive here?
Hello! I don’t need the URLs to be case sensitive. I just need one of them and at the moment, there are two of the same URL for each user, one with capitalized names and one without. How do I delete one of the URLs?
The URLs are “duplicated” because they are case-insensitive. It sounds like you want them to be case-sensitive, although you’re saying you don’t want that, which is confusing.
Hi,
I don’t mean to be confusing! For some reason, there are 2 URLs for each user on the forum. I did not create them intentionally. How do I delete one of them so there is only one URL for each user?
I think you need to clarify what you mean by this.
Where on your forum are “2 URLs” for each user appearing? There is a visual duplication?
I know, I’m going off topic, kind of, but I’m curious and as an pure end-user I would like to understand basics: if an url is case-insensitive should there be then only one url? There would be then some regex-magic. And if there is different urls based of caps on/off would it be sign of case-sensitive situation?
There are not two, there are many, one for each case of each letter. Do you want them to ask redirect to the desired case? There is no way to delete the urls.
How is having the url be far insensitive a problem?
Well the easiest implementation (Using regex since you mentioned it) off the top of my head would be:
// Using express here, first thing that came to mind
const express = require('express');
const app = express();
app.get("/Some-URL", (req, res) => {
res.send("Hi");
});
app.use((req, res) => {
if (/^\/some-url$/i.test(req.url)) {
res.redirect("/Some-URL");
}
});
app.listen(() => console.log("Server Running"));
Yes, for example:
// Using express here, first thing that came to mind
const express = require('express');
const app = express();
app.get("/Some-URL", (req, res) => {
res.send("Hi");
});
app.get("/some-url", (req, res) => {
res.send("Lowercase, eh?");
})
app.listen(() => console.log("Server Running"));