Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

want to rewrite; /play-reel/miranda-bowen/playpeaches-and-cream to /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

share|improve this question

migrated from serverfault.com Feb 16 '11 at 5:03

This question came from our site for system and network administrators.

Take a look at the code you’ve provided in the answer. I’m not sure, but it might look like this:

RewriteRule ^play-reel(.*)\$ mobile/play-reel/$1/$2 [R=302,NC] 
share|improve this answer

this works but doesn't modify the visible url

RewriteRule ^play-reel(.*)\$ play-reel-new-html5-02.php?director=$1&video=$2 [L]

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.