.htaccess rewrite rule help need

mylikes786

Registered Member
Joined
Oct 31, 2013
Messages
81
Reaction score
7
Hello All I want know how can i rewtite text using .htaccess
<img src "http//guio.com/1.png" width "10">
to
<iframe src "http//guio.com/1.png" width "25">

In .htaccess I want set rewrite rule

How can i do this
 
You don't need .htacces for that dude. Use CSS rather:

Code:
iframe {
width: 25px !important;
}
 
Using jQuery you could loop through all your image tags src values using each() or map() then modify using replaceWith().
Code:
var src = $('img').attr('src');
$('img').replaceWith( '<iframe src="' + src + '" width "25">' );


Hello All I want know how can i rewtite text using .htaccess
<img src "http//guio.com/1.png" width "10">
to
<iframe src "http//guio.com/1.png" width "25">

In .htaccess I want set rewrite rule

How can i do this
 
Thx MrBlue, here's the code with a loop if OP finds it too "difficult" to do on his own. Just a little note, there's no need for the src variable which adds up to the memory a little.

Code:
$('img').each(function(){
$(this).replaceWith( '<iframe src="' + $(this).attr('src') + '" width "25">' );
});
 
Last edited:
Back
Top