1
www가 아닌 www와 관련된 문제가 있습니다. .htaccess 파일의 다른 모든 내용이 예상대로 작동합니다. 내 htaccess는 다음과 같습니다.htaccess www가 작동하지 않고 www가 작동하지 않고 다른 작업이 리디렉션됩니다
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
# Redirect old URLs to new ones
RewriteRule ^(about)$ about-us [L,R=301]
RewriteRule ^(contact-us)$ contact [L,R=301]
#Place index.php after hostname
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $2 !\.(gif|jpe?g|png|css|pdf|swf|fla|ppt|php|js)$ [NC]
RewriteCond $1 !\.(gif|jpe?g|png|css|pdf|swf|fla|ppt|php|js)$ [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
다른 리디렉션이 작동하지만 www가 아닌 www는 작동하지 않습니다. 누구든지 올바른 방향으로 나를 가리킬 수 있습니다. 감사합니다
다양한 도메인 동의어로 phpinfo 스크립트를 실행하여 호스트가 HTTP_HOST를 올바르게 설정하고 있음을 확인 했습니까? 일부 호스팅 서비스는 Apache 루트 설정에서 이것을 처리하고 재설정합니다. – TerryE
@TerryE 답장을 보내 주셔서 감사합니다. 올바르게 설정되어있는 것 같습니다. HTTP_HOST \t www.mysite.com HTTP_CONNECTION \t keep-alive – Henrick
@Henrick 다른 디렉토리에 여러 개의 .htaccess 파일이 있습니까? – Prix