0

www가 아닌 ​​트래픽을 www로 리디렉션 한 다음 일부 URL을 다시 쓰는 url 관리에 대한 다음 규칙이 있습니다. "http://example.com/prosite/"(www가없는 경우, 첫 번째 리다이렉션 케이스 - "^ $")을 제외하고는 정상적으로 작동하는 것 같습니다. 나는 이것이 홈 페이지 (http://www.example.com/prosite/index.php?page=home으로 리다이렉트되어야 함을 의미)를 가져올 것으로 기대할 것이다. 그러나 그것은 나를 "http://www.example.com"으로 리다이렉트한다. 당신의 도움을 주셔서 감사합니다.하위 디렉토리의 htaccess가 기본 도메인으로 리디렉션됩니다.

RewriteEngine On 

RewriteBase "/prosite/" 

# redirect non-www addresses to www 
# redirect condition: hostname does NOT contain 2 or more dots 
RewriteCond "%{HTTP_HOST}" "!\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\." 
RewriteRule "^(.*)$" "http://www.%{HTTP_HOST}/prosite/$1" [R=301,L] 

# redirect empty path to home page 
RewriteRule "^$" "index.php?page=home" [NC,L] 

# redirect page path to corresponding page 
RewriteRule "^(home)/?$" "index.php?page=$1" [NC,L] 

# redirect all other paths to index.php (without a "page" argument this will show the default page: 404 not found) 
RewriteRule "!^index\.php$" "index.php" [NC,L] 

답변

0

분명히 브라우저 캐시 문제였습니다. 나는 캐시를 비웠다.

관련 문제