2011-09-27 7 views
1

다른 규칙과 통합 ...어떻게 ... htaccess로를 사용하여 대체 URL을 생성하고이 같은 디렉토리 구조를 가지고

.../htdocs/domain/example/ <==> http://example.com/home/ 
.../htdocs/domain/example1/ <==> http://example1.com/home/ 
.../htdocs/domain/example2/ <==> http://example2.com/home/ 

그리고 나는 또한 기본 파일 영역을 가지고

.../htdocs/domain/default 

내가 요청을하고 싶습니다 ...

http://example.com/home/logo.jpg ==> .../htdocs/domain/example/logo.jpg 

BUT if the file doesn't exist it should return 

            ==> .../htdocs/domain/default/logo.jpg 

답변

0

내 자신의 질문에 대답 ...

,369

난 당신이 그때는 내가 만든 것을 발견/기본을

을에서 시도를 찾을 수없는 파일을 encountewr 경우 기본적으로 내가 말한다 /의 htdocs에/도메인이 htaccess로 파일/

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([a-zA-Z]+)/(.*)$ /default/$2 [L] 

추가 재귀 적 문제가/htdocs/default에 두었 기 때문에/htdocs/default에 두었습니다.

관련 문제