Problem using iframe feature with https
-
Hi, I have been using the iframe feature which has been working great, but now when I have enabled SSL on my website I cannot load the forum in the iframe anymore. Everything worked well with plain http.
This is what I did:
– Enable Let’s Encrypt SSL feature frommy web hosting company
– Changed the WP Setting about URL to the new https url
– Changed the url to https in the w3all settings in WP
– Changed from http:// to https:// in phpBB Admin Server settings
– Updated the links in overall_footer.html so they use https instead of http
– Enabled recompile in phpBB and loaded the forum from the direct linkThe forum is working without the iframe at https://wp2.transamclub.se/phpBB3
Have I missed something?
Update: I’m using the latest version of your plugin.
/Tomas
-
This topic was modified 6 years, 3 months ago by
tlagren.
-
This topic was modified 6 years, 3 months ago by
tlagren.
The page I need help with: [log in to see the link]
-
This topic was modified 6 years, 3 months ago by
-
In my console, I get this notice:
Blocked loading mixed active content “http://wp2.transamclub.se/phpBB3/”
p.s under Server settings, the
Force server URL settings:
option is set to?
have you try to switch?-
This reply was modified 6 years, 3 months ago by
axew3.
I have tried with “Force server URL settings” On and Off, same result. Now it was off so I turned it on now.
/Tomas
Turn it off, and maybe an htaccess can resolve the problem, forcing any request to be https? Something like to this to be added into your phpBB htaccess top:
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?phpBB3/(.*) https://%wp2.transamclub.se/phpBB3/$1 [R,L]
beside the fact that this problem is thrown by some server configuration or phpBB ACP settings that should be resolved in different way, may can also be resolved via htaccess with the above?
after this:
<IfModule mod_rewrite.c> RewriteEngine on
add this
RewriteCond %{HTTPS} !=on RewriteRule ^/?phpBB3/(.*) https://%wp2.transamclub.se/phpBB3/$1 [R,L]
i do not know your server, but substantially try to make the above work in one way or other and check the result
Hi again and thanks for supporting me 🙂 I tried to disable force url setting and added your rewrite into .htaccess for phpBB and I did also activated my web hosts feature to force SSL connection but the same problem exists. I guess the browser is blocking the first attempt to use http so the request never hits the redirect.
I did also get answer from the support and there is no caching mechanism i front of my website.
So there must be something left that still points to the http site somewhere. I did even do a
$ grep -ri “http:\/\/wp2” * in my webroot but didn’t find anything but I guess the url is built dynamic?I have to debug this in more detail..
/Tomas
This is so weird, I was looking into Chrome developer tools and found the point Where chrome think it’s mixed content. Look at the picture in the link below.
It actually says that the https link is http 🙂/Tomas
Yeaah, it’s working 🙂
I installed a simple iframe plugin to wordpress to have something to play with, and when I putted in the phpBB url in that iframe I got the same problem.
Then I found that if I add slash (/) in the end of the src url in the iframe it’s working (not hitting the HTTP 302 redirect) it’s working.So even if your plugin tell me not to put in the final / in the url to the board in w3all settings I did that and that solved my problem.
So there must be some strange configuration at my web host that prevent me from accessing url’s without the last /.
By adding the / in the w3all config, would that give me other problems later on do you think?
/Tomas
Oh! wow! good shot!
but after this lead to links like these into iframe:
https://wp2.transamclub.se/phpBB3//viewforum.php?f=10 loaded into iframe.
double slashes, that not lead to not make work phpBB links, by the way it is not ok.
The server need to be instructed to correctly serve page in any case, and this is an htaccess instruction or server setting if you have cpanel etc access/hosting or phpBB setting that cause this.
I will return over but i guess you’ll reply with definitive solution soon!p.s please try to do this:
enable a plugin’s last topic widget on wordpress
and then setup the very last option on plugin to serve links on widgets for iframe.
Reset the option of url to phpBB in plugin without the final slash as should be.Now open the wordpress page where the widget appear and click into a link to open the forum page, what happen?
It open ok in this case?To complete (as i assume we are in the clue) if you do not want change or become crazy to know how to change to make this work, you could then resolve adding maybe this, into your page-forum.php:
where
// END MAY DO NOT MODIFY // START a default WordPress page
may just this wild line of code:
$w3all_url_to_cms = (if($w3all_url_to_cms == 'https://wp2.transamclub.se/phpBB3')) ? 'https://wp2.transamclub.se/phpBB3/' : $w3all_url_to_cms;
yeah the http call problem i notified early you into a previous post more above, may you not noted this post.
Unfortunately the above will not change the fact that if url to board is index, the double slash will be present on url by the way, while this will not happen for widgets urls i assume.
You should resolve as said above via htaccess or phpBB ACP settings (if it depend by some otpion on ACP) to correctly render that page, despite it contain or not the last slash.-
This reply was modified 6 years, 3 months ago by
axew3.
Wow, now we’re doing progress 🙂
First I followed your instructions to enable the widget and iframe link and removed the trailing slash in the config and that’s actually worked!
Next I modified page-forum.php with your code to add the trailing slash and that seems to solve my issue. I got some php syntax fail with the code, so I replaced it with the below which I guess do the same thing.
$w3all_url_to_cms .= (substr($w3all_url_to_cms, -1) == '/' ? '' : '/');
Finally I’ve been looking into the behavior with the HTTP 302 Moved redirect. I created a new empty website and the same issue is also there. Then I used a out-of-the box installation of Apache in CentOS 7 at home, it’s the same there.
Then I read the Apache HTTP docs for mod_dir and I think this is a correct behavior. The docs says it’s are supposed to do a redirect if a directory is requested and the url don’t include the trailing slash.
https://httpd.apache.org/docs/2.4/mod/mod_dir.htmlI did also play with mod_rewrite to add the trailing slash, but all examples found is all done with a redirect, which is exactly what’s already Apache is doing.
/Tomas
Great Tomas, let say another thing about the above stupid fix proposed by me above:
and if the code is this instead?
$w3all_url_to_cms = (if($w3all_url_to_cms == 'https://wp2.transamclub.se/phpBB3')) ? 'https://wp2.transamclub.se/phpBB3/index.php' : $w3all_url_to_cms;
adding index.php in case of root, may will do the dirty trick without the result that will add double // after into phpBB?
let knowp.s please notify me when you placed this with default settings (no final slash) into your example, i really guess the result would be ok
p.s i re-read now due to notification email and i see i didn’t read that you already fixed in the other way, that it’s may lead to the same of second suggestion adding index.php. We can say it is quite resolved then, but not all clear!?
-
This reply was modified 6 years, 3 months ago by
axew3.
Yes, with this code added I think the case is solved.
Btw, I tried to add your new code, but PHP doesn’t like the if-statement.
Parse error: syntax error, unexpected ‘if’ (T_IF) in/wp2.transamclub.se/public_html/wp-content/themes/onepress/page-forum.php on line 214
So I added index.php into my substr function instead.
$w3all_url_to_cms .= (substr($w3all_url_to_cms, -1) == '/' ? '' : '/index.php');
Will this fix be included in future release by default, or as an config option? Or do I need to manually add it when new version of the plugin is installed and I rebuild the page?
Thanks for all your help. I just added some positive review to your plugin!
/Tomas
-
This reply was modified 6 years, 3 months ago by
tlagren.
YEAH! this i want to heard because thinking the same… expecting your answer about to be sure … yes! i will go to apply patch within today on repo!
So it will become available to fix this mess from now on.
But would really like to know/discover why this come out …
i can’t reproduce right now, and i regret to had not the ability to understand without having it under my hand maybe into localhost or server under my control.So, until it will not presents to me also, i will not understand until deep why it happen and i feel like a stupid in the while you know.
So if any update about this pain in the a** let know as soon!-
This reply was modified 6 years, 3 months ago by
axew3.
-
This reply was modified 6 years, 3 months ago by
- The topic ‘Problem using iframe feature with https’ is closed to new replies.