2012-10-23 3 views
0

나는 이것에 몇 가지 찌르다가 올바른 구문을 치지 못했습니다. 어떤 도움이라도 대단히 감사하겠습니다. 내 .htaccess 파일은 아래와 같이 읽습니다. 지금까지는 스마트 폰의 모든 방문자를 내 웹 사이트의 모바일 버전으로 리디렉션해야했습니다. 하지만 이제는 내 파일 관리자의 특정 폴더를 .htaccess의 영향으로부터 면제하는 명령을 추가해야합니다. 내 코드에 무엇을 추가해야합니까?.htaccess 파일을 변경하여 특정 폴더를 무시하는 방법은 무엇입니까?

RewriteEngine on 
RewriteBase/

# Check if this is the noredirect query string 
RewriteCond %{QUERY_STRING} (^|&)m=0(&|$) 
# Set a cookie, and skip the next rule 
RewriteRule^- [CO=mredir:0:www.mconchicago.com] 

RewriteCond %{HTTP:x-wap-profile} !^$ [OR] 
RewriteCond %{HTTP:Profile}  !^$ [OR] 
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC] 
RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] 

# Check if we're not already on the mobile site 
RewriteCond %{HTTP_HOST}   !^m\. 
# Can not read and write cookie in same request, must duplicate condition 
RewriteCond %{QUERY_STRING} !(^|&)m=0(&|$) 

# Check to make sure we haven't set the cookie before 
RewriteCond %{HTTP_COOKIE}  !^.*mredir=0.*$ [NC] 

# Now redirect to the mobile site 
RewriteRule^http://m.mconchicago.com [R,L] 
+0

당신이하고있는 일에 대한 제쳐두고 : 스마트 폰에서도 정식 버전을 사용할 수 있는지 확인하십시오. 모바일 버전에서 제대로 작동하지 않는 항목이 있고 휴대 전화가 전체 사이트를 제대로 처리 할 수있을 때가 싫지만 브라우저가 사용자 에이전트로보고 전체 사이트로 이동한다는 사실을 변경해야합니다. – Jasper

+0

의견에 감사드립니다. 전체 사이트에 대한 링크가 항상있었습니다. 그러나 당신이 그것에 대해 생각하는 방식은 나를위한 새로운 시각입니다. –

답변

0

나는 이것을 몇 달 동안 알아 내려고 노력해 왔습니다. 오늘 밤에 오디세이가 마침내 끝났다.

RewriteEngine on 
RewriteBase/

은 다음과 같이 읽으려면 :

RewriteEngine on 
RewriteRule ^family($|/) - [L] 
RewriteRule ^photos($|/) - [L] 
RewriteRule ^info($|/) - [L] 
RewriteBase/

이 지금은 매력처럼 작동 나는이 부분을 변경했습니다. "가족", "사진"및 "정보"는 .htaccess의 영향에서 면제되는 폴더입니다. 바라기를이 정보는 다른 누군가를위한 시간을 절약 할 것입니다.

관련 문제