Forum Moderators: phranque
.htaccess file
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) [%{SERVER_NAME}%{REQUEST_URI}...] [NC,R,L]
The following examples all use the above rule. The first one doesn't work. In the iframe like the others do but it does work without the IFRAME:
Doesn't Work:
http://www.example.com/support/social-media-lab-workshop-registration/
Works without Iframe:
[example.com...]
IFRAME CODE:
<iframe height="930" allowTransparency="true" frameborder="0" scrolling="vertical" style="width:100%;border:none" src="https://www.example.com/cc-process/formSML-Cart-GA.php"><a href="https://www.example.com/cc-process/formSML-Cart-GA.php" title="Our Online Payment System"><a></iframe>
EXAMPLES that work in and out of iframe:
[example.com...]
[example.com...]
[example.com...]
[edited by: jdMorgan at 12:50 am (utc) on Nov. 17, 2009]
[edit reason] example.com [/edit]
1) Be sure you completely flush (delete) your browser cache after changing any server-side code, in order to avoid seeing stale browser-cahced results.
2) .htaccess code will only affect requests which resolve to this server and to files in this .htaccess file's directory, and --only if "RewriteOptions inherit" is set-- in directories below this .htaccess file's directory.
Jim
1) I tested in multple browser to ensure "it doesn't work"
2) All files for the ones that "do work" are in the same directory compared to the one that "doesn't work".
As I stated clearly, all the pages use the same rules and they are in the same directory on the same server.
Obviously, something somewhere is changing something about the request, which causes it to not match the pattern in the rule when "it doesn't work." It's also possible that the requested URL *would* match the rule, but that the rule is located in a server filepath which is not traversed when the request comes from an iFrame -- In other words, some other code or directive grabs the iFramed request and does something with it before your rule can run. This could be a higher-level .htaccess file, or a server config file, or even a 'wrapper script' if you use such.
Jim
The first thing in every one of the above examples includes this conditional in addition to the .htaccess file:
if($_SERVER["HTTPS"] != "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ["...] . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
exit();
}
after looking at the cpanel error log I found
[Tue Nov 17 15:01:27 2009] [error] [client 99.28.249.30] File does not exist: /home/#*$!x/public_html/cc-process/images/cmxform-divider.gif
[Tue Nov 17 15:01:24 2009] [error] [client 99.28.249.30] File does not exist: /home/#*$!x/public_html/cc-process/images/cmxform-fieldset.gif
I've correct the issue by creating the directory and places images there. Still did not correct the issue.