2014-11-13 3 views
1

도메인에 키워드가없는 경우 어떻게 리디렉션 할 수 있습니까?도메인에 키워드가없는 경우 htaccess 리디렉션

예 :

허용 된 액세스를 내 도메인이

www.example.net/example/thisisallowed* 

또는

www.example.net/examplefolder/thisisallowedtwo 

그리고 예를 당

www.example.net/example/notallowed 

또는

같은 다른 모든 URL이 있습니다
www.example.net/example/anotheruri 

은 금지되어 있습니까?

내 URL 키 thisisallowed없이 모든 URL로 리디렉션되어서 너무 :

www.example.net/example/thisisallowed 

답변

0

당신은 당신의 DOCUMENT_ROOT/.htaccess 파일에이 코드를 사용할 수 있습니다

RewriteEngine On 

RewriteCond %{HTTP_HOST} ^(www\.)?example\.net$ [NC] 
RewriteCond %{THE_REQUEST} !/thisisallowed [NC] 
RewriteRule^http://www.example.net/example/thisisallowed [L,NC,R=302] 
+0

들으 당신의 대답. 슬프게도 이것은 작동하지 않습니다 ... : - /이 오류가 발생합니다 : 오류 : 리디렉션 오류 사이트가 요청을 완료하지 못하게 리디렉션하고 있습니다. – goldlife

+0

확인 지금 나의 업데이트 된 규칙을 사용해보십시오. – anubhava

관련 문제