I add rewriterule to my .htacces file to add ‘www’ to my website, now they add www but I get always this error 500
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
2
Answers
You should add an A record with www
The redirect you added is just redirecting your site abc.com to http://www.abc.com .. but in the backend, on server, www points nowhere.
So you should go to your DNS settings and add an “A” record with domain www , type A record and point to the IP address of your server.
Hope that helps.
You are getting a 500 internal server error/infinite loop error because your rule
RewriteRule . /index.php [L]
rewrites all requests (including/index.php
) to/index.php
. In order to solve this , You need to exclude the Uri you are rewriting to :