2016-07-29 2 views
0

/google /의 디렉토리가있는 것을 제외하고 모든 트래픽을 홈페이지로 리디렉션하고 싶습니다. 나는 기본 wordpress를 재 작성하여 index.php가 삭제되도록하고 싶습니다.한 페이지를 제외한 모든 트래픽을 홈 페이지로 리디렉션

# Need to leave certain files alone 
RewriteCond %{REQUEST_URI} !.(gif|jpeg|png|css|js|woff|ttf|eot|svg|otf|woff2|jpg)$ 

# No redirects on home page (obviously) 
http://example.com 

# Everything else should redirect back to http://example.com (home) 
http://example.com/* 

# All variations of the following should NOT redirect 
http://example.com/google/ 
http://example.com/google 
http://example.com/google/index.php 

고마워요!

답변

0

사용 규칙을 달성하려면이 규칙을 사용해야합니다.

RewriteRule !^google($|/) http://example.com%{REQUEST_URI} [L,R=301] 
+0

기본 WP 규칙과 함께 사용법은 무엇입니까? 비슷한 규칙을 시도했는데 리디렉션 루프가 발생했습니다. 나는 이것이 작동한다면, 이것으로 한 발을 발사하고 대답 할 것이다. 감사 – DeFeNdog

관련 문제