views:

39

answers:

1

hello there.

just need one url on my site to check if its a mobile device and then rerite the url accordingly.

want to rewrite; http://2amfilms.co.ukl/play-reel/miranda-bowen/playpeaches-and-cream to http://2amfilms.co.ukl/mobile/play-reel/miranda-bowen/playpeaches-and-cream

RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$ [NC]
RewriteRule ^play-reel(.*)\$ mobile/play-reel$1 [R=302,NC]  

RewriteRule ^mobile/play-reel/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)$ play-reel-new-html5-02.php?director=$1&video=$2 [L]
# the 3rd line works but cant get the url to change for it to be picked up

can anyone see what's wrong? There's no erro

best, Dan

A: 

Maybe instead this:

RewriteRule ^play-reel(.*)\$ mobile/play-reel$1 [R=302,NC] 

Try:

RewriteRule ^play-reel(.*)$ mobile/play-reel$1 [R=302,NC] 
nanda
that nearly does but transforms 1$ into the filename
daniel Crabbe
nanda
nearly! i want /mobile/play-reel/miranda-bowen/playpeaches-and-cream processed internally as there is rule ready to pick that up (3rd line). So i just need to transform the url if its an iphone before then...
daniel Crabbe