开发者

Simple JPG/HTML Not Showing Up in iPhone

I'm not familiar with iPhones wants and needs, nor do I have one, but a client wants a screen cap of his site to show up when an iPhone user comes around so I created an .htaccess redirect to an iPhone specific page with this bit of code...

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} iPhone
RewriteCond %{REQUEST_URI} !^/iPhone/
RewriteRule .* /iPhone/ [R]

And the html of the iPhone page...

<html>
<head>
&开发者_运维知识库lt;title>Eatamadedia</title>
</head>
<body style="background-color:#858384;margin:0 auto;">
<img src="../images/iPhonePage.jpg"> 
</body>
</html>

The page redirects just fine, but the .jpg doesn't show up. I can't imagine a simpler page. Anyone know what could be preventing the image from displaying? Does the iPhone require headers?

The site in question is http://eatamedida.com

Thank you in advance for your input. -J


You're rewrite rule is causing a redirect loop for the images directory. Change it to:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} iPhone
RewriteCond %{REQUEST_URI} !^/iPhone/
RewriteCond %{REQUEST_URI} !^/images/
RewriteRule .* /iPhone/ [R]

In future you can use Firefox with the User Agent Switcher add-on to fake the iPhone user-agent and debug these kinds of issues using Firebug.


Well, one of the issues is that the pic on the iPhone page (this one) isn't really suitable for the iPhone's screen resolution. You should consider changing the pic to a 320x480px resolution one.

However, I don't really understand the need for iPhone users to see the site screenshot, anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜