html - htaccess mobile redirect to subdirectory -


I have customized an htaccess file which was made available here, but checking what I am trying to do That the user is not already in subdirectory (rather than subdomain) in domain.co.uk/mobile and if not, then redirect him to the mobile site.

However, it just falls into an infinite loop and therefore fails.

Can anyone tell me what is the problem and how can I do such revittances?

  RewriteBase / RewriteEngine at # Check whether this noredirect query string is revoked,% {QUERY_STRING} (^ | & amp;) M = 0 (& amp; |), set the cookie, and skip ^ [$] [Or] Rivoite condom% {http: profiles}! ^ $ [Or rechristake =] rewrite% {HTTP_USER_AGENT} "acs | alf | alka | mmi | audi | aee | avan | bayoncke | bird | black | blaze | bruw | cell | ceildse | cmd" "[nc, orr ] REVEAL Conduct% {HTTP_USER_AGENT} "Dang | DOCO | Eric | HIT | INO | IPC | Jiva | Jags | KDD | KG | Lino | LG-C | LG-D | LG-G | Liege -" [NC, OR] RewriteCand% {HTTP_USER_AGENT} "Mau | Maxo | Mids | Mits | MMEF | Moby | Mot | | Moto | MWB | Nek- | Newt | Nokia | opwv "[nc, OR] referencond% {HTTP_USER_AGENT}" pam | pana | pants | pdx | phil | play | pluck | ports | proxy | quacket | quap | rishi | sam | sunny "[nc, or] revark % {HTTP_USER_AGENT} "SEH- | Sec- | Send | Serie | Saf-| Shar | Sie | | Siemens | Smile | Smear | Sony | SPH | | SMB | T-Mo" [NC, OR] Remit Conduit% {HTTP_USER_AGENT} } "Tele | tim- | toish | ssm | apg1 | abse | vk- v | voda | w3cs | wap- | vpa | yipi" [nc, or] rivvyte condom% {HTTP_USER_AGENT} [nc , Or] Rev45% [HTTP_USER_AGENT} "up.browser | Up.link | Windowssce | Iemobile | Mini | MMP "[NC, or] rewrite% {HTTP_USER_AGENT}" Symbian | Midp | WAP | Phone | Pocket | Mobile | PDAs | PSP "[NC] Rev.% {HTTP_USER_AGENT}! MCINTOSH [NC] #Check if we are not already on the mobile site REWAVE BRANCH% {REQUEST_URI}! ^ / Mobile / [NC] # Read the cookie in a single request and Can not write, duplicate status should be duplicated again% {QUERY_STRING}! (^ | & Amp;) M = 0 (& amp;; $) # RewriteCond% {HTTP_COOKIE} can not set cookies before! ^ . * Mredir = 0. * $ [nc] # redirect to mobile site now rewritere ^ http://www.domain.co.uk/mobile [R, L]   

You should replace your mobile site check with ! / Mobile / to < Code>! ^ [/]? Mobile Apache does not always include the leading slash in REQUEST_URI This regex creates that leading slash is optional, so the rule will work if slash exists Or not.

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -