2013-04-15 2 views
0

다음은 http://subdomain.example.com/script.php특정 파일에 대한 다시 쓰기를 제외하고 다른 모든 요청을 동일한 파일에 다시 쓰는 방법은 무엇입니까?

을 실행하기 위해 재 작성해야 http://subdomain.example.com에 관해서 내 요구 사항,

어떤 요청입니다 그러나 모든 요청은 다른 곳에서는 다시/리디렉션 안 http://subdomain.example.com/script.php에 직접 제공됩니다.

다시 작성 루프를 끝내지 않고 어떻게 만들 수 있습니까?

답변

1

http://subdomain.example.com에 대한 요청은 http://subdomain.example.com/script.php을 실행하도록 다시 작성해야합니다.

그러나 모든 요청은 http://subdomain.example.com/script.php으로 직접 전송되어야합니다. 은 다른 곳으로 리디렉션되거나 다시 작성되어야합니다. script.php에뿐만 아니라 요청을 통해 규칙에서 제외 전달됩니다

Options +FollowSymlinks -MultiViews 
RewriteEngine On 
RewriteBase/
RewriteRule ^$ /script.php   [L,NC] 

을하지만, 어떤 : 바로 이해하면

, 당신은 subdomain.example.com 루트 디렉토리에 하나 개의 .htaccess 파일에서 이것을 시도 할 수 있습니다 URI 경로에 무언가가있는 다른 요청은 규칙을 사용하기 위해 비어 있어야합니다.

관련 문제