• Hi!
    Please help me in understand the following WordPress behaviour.

    I have registered the domain without www. When trying to open https://www.mydomain.com the domain without www is opened. I thought that no page will be found us I registered domain without www.

    I thought that it is caused by .htaccess file. But when I removed it for a while the behaviour is the same.

    Is there any magic code in WordPress which causes such behaviour?

    thanks in advance,
    Grzegorz

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Gregosz

    (@gregosz)

    Hi,
    And one more aspect.

    I have added test.html file to the same server. And behaviour is different. I can open pages: https://www.domain.pl/test.html and https://domain.pl/test.html. And there is no redirection from www to without www.

    Now I am confused even more….
    Grzegorz

    I have registered the domain without www.

    First, all domain names are registered without www –?the www is a subdomain.

    And most hosting providers pre-configure the DNS to point both the www subdomain and non-www domain to the same place; this way both URLs work out-of-the-box.

    Is there any magic code in WordPress which causes such behaviour?

    WordPress does not control the behavior of how your domain name works –?that would be your server and/or DNS configurations.

    I thought that it is caused by .htaccess file. But when I removed it for a while the behaviour is the same.

    The .htaccess file is an Apache server file that can be configured to handle URL redirects for things like forcing www or non-www URLs. Yours might not have been configured to do anything –?which is why the behavior did not change when you removed it.

    I have added test.html file to the same server. […] And there is no redirection from www to without www.

    A static .html file or any other static files (.jpg, .pdf, .zip…etc) will not initiate any redirects or URL rewrites unless your server is configured to do so. I suspect that your DNS settings point both the www subdomain and non-www domain to the same place; which means, no matter which URL you use, it still loads the files from the same server with the same URL path.

    I suggest you contact your hosting provider for help with this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirecting www to non www without .htaccess file’ is closed to new replies.