Website Won't Load without WWW Prefix - WordPr

2019-09-06 16:23发布

问题:

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?

回答1:

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.



回答2:

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:

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]


回答4:

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

This proccess is working for me.