2013-03-12 2 views
0

.htaccess-file 작업에 문제가 있습니다. 나는 당신이 http://example.com/hello/fire/를 호출하는 경우 그래서, 그 URL이해야, http://example.com/에 "리디렉션"http://example.com/inc/로 시작하지 않는 모든 URL을 원하는 지금 예를 http://example.com/inc/style.css.htaccess 리다이렉트 (항상 그렇지는 않음)

를 들어,/INC/폴더에 저장된 이미지와 .CSS-파일이 여전히 주소 표시 줄에 있지만, http://example.com/을로드하십시오. 따라서 주소 표시 줄에서 URL을 변경하면 안됩니다.

누군가가 어떻게 작동하는지 알고 있습니까?

마크

답변

2

시도 :

RewriteEngine On 

# This prevents the rewrite engine from looping 
RewriteCond %{ENV:REDIRECT_STATUS} 200 
RewriteRule^- [L] 

# If URI starts with "/inc/" do nothing (passthrough) 
RewriteRule ^/?inc/ - [L] 

# Otherwise if URI is at least 1 character (not "/"), rewrite to "/" 
RewriteRule ./[L] 
관련 문제