htaccess redirect

Discussion in 'PHP' started by adamjblakey, Jul 19, 2011.

  1. #1
    Hi,

    I am using the following code to redirect my site to a mobile friendly site:

    
    #redirect mobile browsers
    RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
    RewriteRule ^(.*)$ http://www.mysite.mobi/ [R=301]
    RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
    RewriteRule ^(.*)$ http://www.mysite.mobi/ [R=301]
    RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
    RewriteRule ^(.*)$ http://www.mysite.mobi/ [R=301]
    
    Code (markup):
    Which works fine however i have one URL which is:

    http://www.mysite.co.uk/adminxx/login

    That i dont want redirected if i go to this on my mobile. Is there a way to do this?

    I tried doing this: RewriteCond %{REQUEST_URI} !^adminxx\/login but it did not work

    Cheers,
    Adam
     
    adamjblakey, Jul 19, 2011 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #2
    dude try:
    RewriteRule ^adminxx/login - [L]
     
    gapz101, Jul 23, 2011 IP