I've a very specific problem with magento. At first let me explain what the problem is. I load magento into an iFrame to integrate the store into a webpage. This works like charm until it comes to amazon pay or unzer for example. Due to the iFrame, the payment fails or does not load at all (for security reasons).
My first idea was to break out of the iFrame, but I have no clue how to do it. So my second thought was I load the checkout page on top (leave the iFrame at this point) and create a page like amazons checkout page. But in this case, if I just redirect to the "origin" checkout page, the "REQUEST_URI" would change from "/shop/de/checkout" to "/store/de/checkout". To avoid this, I modified the .htaccess page from the webpage and added this rule:
RewriteCond %{REQUEST_URI} (checkout|checkout\/)$ [NC]
RewriteRule ^shop/(.*)$ /store/$1 [L,NC]
And yes, the REQUEST_URI doesn't change and the Magento store loads, but instead of the checkout page, I get a "The page you requested was not found" page. If I change the RewriteRule to
RewriteCond %{REQUEST_URI} (checkout|checkout\/)$ [NC]
RewriteRule ^shop/(.*)$ /store/$1 [R=301,L,NC]
it works - but the REQUEST_URI change (because of the redirect of course) and I have to avoid that.
It would be awesome if someone could explain why it behaves this way - and how I can fix that.