MyBB Community Forums

Full Version: http & https?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
All,
I have a board that I've run under both https and http. Both have merits, and some users prefer the encryption, while others dislike it. (I won't go into specifics as to why.) What I guess I'm looking for is a method of hosting the board on both. Toungue Essentially, I'm thinking I'd have 2 separate ports open, and depending on which one the user uses, either the link is encrypted or not.

Now, the only problem I know of with doing this is setting the board's URL in the AdminCP settings. Since only 1 URL can be set, regardless of how I connected (https or http), any click would push me back into the one set in the AdminCP.

Any thoughts as to how I could get around this, and have 2 URLs pointing at the same mybb? I'm sure this question has come up before, as having multiple URLs isn't all that odd. That said, I may be the first to ask about whether or not the URL in question can be maintained throughout the session.

For starters, as a novice PHP programmer, here was my thought: Could I alter my board to use PHP to detect the URL, and - to bump back up security - compare it to a list of valid URLs set in AdminCP? (Perhaps I could add a couple of them through the AdminCP using CSV?)

Thoughts?

Thanks!
- Ichi
That's a bit of an interesting request.


Since I don't have HTTPS set up, I have no way of testing this, but anyway, try this plugin:
[attachment=9555]

All it does is try to detect if the user requested the page via HTTPS, and change the URL accordingly.
You should be able to modify it to suit your needs if you can write PHP Toungue
Zinga, thanks for the lead! I use some port redirection on the site in question. So, I need to touch-up a bit more than the https at the front. However, that simple replacement should get my started.

Thanks again! I'll post back here what I come up with so others can see if they're interested.
Thanks again Zinga... that's working perfectly. I made a slight mod to it to handle my port redirection, and VIOLA!

I started working out a bit more of a plugin interface to it (giving it an AdminCP front end for entering port #s, etc.), but I got lazy and just quit. This serves my purposes just fine. So, I guess it's foolish to beat a dead horse into the ground.

If anyone else is interested in something that doesn't require PHP mods to control the URL redirection, let me know and I'll post my more involved do-dad. Otherwise, what Zinga shared above is perfect!