2013-05-21 3 views
0

다음과 같은 유형의 동적 URL이 있습니다.htaccess를 사용하여 동적 URL을 정적 URL로 리디렉션

http://example.com/interviews/sample1/data.xml 
http://example.com/interviews/sample1234/data.xml 
http://example.com/video/video-2/data.xml 

여기서 인터뷰 중 sample1, sample1234, video, video-2 ... 등은 동적 이름입니다. 해당 URL을 동적 URL 다음으로 정적 URL으로 리디렉션하고 싶습니다.

http://example.com/data.xml 

감사

답변

2

시도 :

RedirectMatch ^/.+/data.xml$ /data.xml 

또는 사용 mod_rewrite를 :

RewriteCond %{REQUEST_URI} !^/data.xml$ 
RewriteRule /data.xml$ /data.xml [L,R] 
+0

우수한. RedirectMatch^/. +/data.xml $/data.xml 잘 처리했습니다. 내 시간을 구 했잖아. 고마워요! –

관련 문제