Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redirect for themes.html #181

Merged
merged 1 commit into from
Jan 8, 2019
Merged

Add redirect for themes.html #181

merged 1 commit into from
Jan 8, 2019

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Nov 21, 2018

It's linked here: https://github.com/thelounge/thelounge/blob/dedaa1f33767b94bf3c2f0208a37e6877800d248/defaults/config.js#L68

If you try going to next subdomain, it 404s instead of redirecting.

Perhaps we need a *.html redirect or specify all the other rewrites with .html?

@xPaw xPaw requested a review from astorije November 21, 2018 16:26
@astorije
Copy link
Member

astorije commented Dec 5, 2018

I'm really confused, the URLs without .html used to redirect fine. I remember specifically testing that, I wonder what broke it.

There is some sort of precedence in how they handle 1) removing the .html 2) checking the redirects file. This tells me I got the precedence wrong (again, wondering why since it used to work). So instead of adding a themes.html redirect, we should add .html to all of them. Mind trying that and seeing if it works?

@xPaw
Copy link
Member Author

xPaw commented Dec 5, 2018

Yeah that doesn't work, we have to specify both .html and no .html versions...

It probably broke when we 'fixed' .html removal on existing pages.

@astorije
Copy link
Member

astorije commented Dec 7, 2018

Yeah that doesn't work, we have to specify both .html and no .html versions...

That doesn't feel right, I'm pretty sure their engine used to normalize stuff first. Let me reach out to them and show them this.

@xPaw
Copy link
Member Author

xPaw commented Dec 23, 2018

Did you reach them? I'd say we do this for now, until we find a better solution.

@astorije
Copy link
Member

astorije commented Dec 26, 2018

I did, twice in fact, and it looks like my messages got dropped on their support system, that's annoying. I'll reach out again.

EDIT: Done, will follow-up here when I have news.

@astorije
Copy link
Member

astorije commented Jan 8, 2019

So this is the answer I got from them:

We don't rewrite urls with the extension automatically, even with pretty urls enabled. What pretty urls does is it changes the actual links in your html code to remove the extension. That said, the only way to accomplish what you need is to duplicate your redirects.

You could do this using a script so you don't have to do this by hand. You just need the _redirects file to exist in the _site folder by the end of your build. Hope that clears up the situation a bit.

So it seems like duplicates are the only way to go, bit of a shame. I'm not sure it's worth the maintenance effort of dynamically generating the file however when a handful of duplicates would do.

@astorije astorije changed the title Add redirect for themes.html Add redirect for themes.html Jan 8, 2019
@xPaw xPaw merged commit 600a492 into master Jan 8, 2019
@xPaw xPaw deleted the xpaw/html-redirects branch January 8, 2019 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants