I have a .htaccess file like this:
RewriteRule ^(iphone)/(.*)\.html$ /$2.php?specialversion=$1 [L,QSA]
My problem is that when viewing http://www.example.com/iphone/mypage2.html, mypage2.php gets called and output contents but none of the images or even the CSS are working. How can I solve this?
You could use a new HEAD tag in your HTML in
mypage2.php(and the other pages), when GETspecialversionis set. The images will otherwise be fetched from http://www.example.com/iphone/images/… or similar, which is not redirected):Of course, you could use another
RewriteRulein the .htaccess instead.This RewriteRule rewrites
imagesandstyledirs. Remember that the cache wouldn’t be used if a client uses both the main site and theiphonesite (which probably isn’t a problem).