문제

I tried googling this problem about a site do not open without www, here's my .htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^(.*)$ "http\:\/\/www\.mydomain\.com\/$1" [R=301,L]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
도움이 되었습니까?

해결책

Your rewrite condition is slightly wrong try this:

RewriteCond %{HTTP_HOST} ^(.*).domain.com [NC]
RewriteRule ^(.*)$ http://domain.com $1 [L,R=301]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top