0

enter image description here I am working on a Wordpress project which is deployed on wordpress.com hosting. Simply I want to redirect the website from (with SSL)non-www to (with SSL) www.

I have searched over web and there are plenty of plugins who does the job, but there is a problem with wordpress hosting, it redirects back from www to non-www and resuslts error "too many redirects". I tried to change settings from admin panel settings> General > site url. But its disabled there, I cannot change it. This option is enabled to change on other hosting servers but not on wordpress.com hosting.

I tried it to do that through htaccess but still not working.

if information is not enough I can provide more info.

Kindly help me out with this problem.

Thanks in advance!

1 Answer 1

0

Unfortunately on wordpress.com hosted sites, the www is automatically removed.

For self-hosted wordpress installs, there are several ways to do this.

In .htaccess file using something like:

Options +FollowSymlinks
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

or set values for WordPress address and Site address in the Wordpress Admin Dashboard:

Settings > General

or define in your wp-config.php file:

define('WP_HOME',"http://www.example.com");
define('WP_SITEURL',"http://www.example.com");

or in your theme functions.php file or a plugin.

I think your issue might be one of the above is conflicting with your changes which then causes a redirect loop.

2
  • Hi. I have tried all these options. But none is working on wordpress.com hosting and working fine with other hosting servers. I have edited my question and added a screenshot there. You can see that option to change is disabled on wordpress hosting Commented Dec 19, 2019 at 10:42
  • I've amended my answer as on wordpress.com hosted the www is automatically removed. See here under FAQ for clarification: en.support.wordpress.com/domains/map-subdomain
    – TomC
    Commented Dec 19, 2019 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.