Website Won't Load without WWW Prefix - WordPr

2019-09-06 16:17发布

We had this issue before with our old website, but only in certain browsers. We recently pushed our new website live and the issue now seems to be affecting all browsers. When you visit the website without the WWW prefix, you are taken to a "Under Construction" page that I'm told is a server error page of some sort.

Here is the domain: www.mcfaddengavender.com

Here is my current .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Would it be possible to force all browsers to load the WWW prefix?

4条回答
等我变得足够好
2楼-- · 2019-09-06 16:55

Your .htaccess file looks fine and is normal.

You don't need anything in .htaccess to force or remove www with a Wordpress site. Add or delete the www prefix in Dashboard>>Settings>>General and save.

查看更多
手持菜刀,她持情操
3楼-- · 2019-09-06 17:00
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mcfaddengavender\.com$ [NC]
RewriteRule ^(.*)$ http://www.mcfaddengavender.com/$1 [L,R=301]

This proccess is working for me.

查看更多
乱世女痞
4楼-- · 2019-09-06 17:11

DNS propagation could explain why it does not work. No, you should not need to force browsers to reload with www (which I just saw you did). You should use a CNAME record in your DNS to map your www subdomain on your main domain.

查看更多
何必那么认真
5楼-- · 2019-09-06 17:18

Not sure if this will solve the issue you're having, but to force a www in the domain name, you can add this above the # BEGIN WordPress line:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mcfaddengavender\.com$ [NC]
RewriteRule ^(.*)$ http://www.mcfaddengavender.com/$1 [L,R=301]
查看更多
登录 后发表回答