N
N
nelolka2019-02-24 21:22:56
PHP
nelolka, 2019-02-24 21:22:56

How to load a page in a frame?

How to load requested page in iframe using htaccess and php?
We want the request for index.html to load a page with a frame containing the actual index.html.
I did this:
.htaccess

RewriteEngine on
RewriteRule ^(.*)\.html2$ $1.html [L]
RewriteRule ^(.*)\.html$ index.php?page=$1 [L]


index.php
<iframe src="<?php echo $_GET['page']; ?>.html2" frameborder="0"></iframe>


As planned, it should pass the index.php parameter from .html, which will generate a frame to .html2, which is rewritten to the main html, but they rewrite each other. Something I'm completely confused. Who will tell? Maybe there is an easier solution?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question