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 www redirect #29

Closed
wants to merge 2 commits into from
Closed

Conversation

redrun45
Copy link
Contributor

As two separate commits, in case there's trouble getting a valid cert for www.

...as a separate commit, in case it needs rolling back!

<VirtualHost *:80>

ServerName www.librivox.org
Copy link
Member

@notartom notartom Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure, but I suspect the same can be achieved by just adding ServerAlias www.librivox.org [1] to the existing config file for librivox.org. Are you able to try it in your localdev env? We still need the other stuff though.

[1] https://httpd.apache.org/docs/2.4/mod/core.html#serveralias

Copy link
Contributor Author

@redrun45 redrun45 Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For *:80, we certainly could just do a ServerAlias. I tested that, it worked just fine.
For *:443, though, the web site does not behave properly when reached as www.librivox.org, so I think it does need its own VirtualHost.
I figured it would be neater to have all things www as their own file, since they wouldn't cleanly fit into (the existing) one. Does that make sense?

@notartom
Copy link
Member

For *:443, though, the web site does not behave properly when reached as www.librivox.org, so I think it does need its own VirtualHost.

#30 seems to work fine on staging? How does it "not behave properly" for you? (Not trying to steal your thunder, just proving stuff out for myself).

@redrun45
Copy link
Contributor Author

(Not trying to steal your thunder, just proving stuff out for myself).

Not at all! If it works, it works. I saw a SQL error styled in a way I haven't seen before, and figured I'd better keep things cleanly separate for the PR. Now I'm curious myself, I'll see if I can trigger that again!

@redrun45
Copy link
Contributor Author

redrun45 commented Aug 12, 2024

Well, if I alter my hosts file to the staging IP, then open https://www.librivox.org/ in Chromium, it... appears to work alright. Click through a few links, and you'll pretty soon be on the regular librivox.org, with no funny business I can see.

On Firefox, I have separate containers for live, dev, and staging. I pulled some proxy shenanigans to get that, and while it's worked well since I set it up, I wonder if that's what's got me seeing funny things. Being a permanent redirect, it's hard to tell for sure, but I think #30 will work. If it causes unexpected trouble, all it takes is a redirect. 😉

Edit to add: And while I haven't seen that exact error again, I'm pretty sure it was WordPress. Which, given that staging and live both have a WordPress database, it makes sense we would get an error only on localdev.

@notartom
Copy link
Member

Replaced with #30

@notartom notartom closed this Aug 17, 2024
@redrun45 redrun45 deleted the add-www-redirect branch August 18, 2024 17:06
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.

2 participants