Forum Moderators: phranque
The .htacces code is the following one:
Options +FollowSymLinks
RewriteEngine on
Rewriterule ^(.*)\.html$ index.php?id=$1
The problem is on a page which includes the following code to load html within iframe:
Code HTML:
< iframe src="_inc/archivo.html" rameborder="0"></iframe >
Apparently, the rules written in the file htaccess modifies "src path" of iframe and it does not load the page, of iframe, correctly.
Somebody can orient to me how to resolve this small problem?
How I Can writte a rule to ignore de iframe source path?
Thank you very much to all!
Welcome to WebmasterWorld!
> How I Can write a rule to ignore de iframe source path?
You can't, because that is not the cause of the problem.
> Apparently, the rules written in the file htaccess modifies "src path" of iframe and it does not load the page, of iframe, correctly.
No, it is not the rule, it is the browser.
You have provided a relative link to archivo.html. It is the client browser that resolves relative links to canonical URLs. So, the browser still believes it is requesting pages from the original directory, not the rewritten directory. As a result, it will take the page URL it is showing in its address bar, remove everything from the last slash in that URL to the end, and then add "_inc/archivo.html". It will then request that page.
One way to fix this is to create a RewriteRule to reverse the previous rewrite for the iframe page only. Another way to do it is to use a server-relative path instead of a relative path. Something like:
<iframe src=[b]"/path_to_inc_from_root/_[/b]inc/archivo.html" frameborder="0"></iframe>
Jim