• Resolved YourOnlineCenter

    (@youronlinecenter)


    Hi Guys,

    I have messed around with this for a bit with no luck and is probs something very simply but i don’t know.

    Anyway when I go to https://example.com/page it shows but when i try to use https://www.example.com/page it redirects me to the homepage at https://example.com/

    So as soon as i use the www. in the domain it goes to the homepage no matter what.

    it does this for all my static pages, its not that annoying only when trying to get to the page directly.

    I have tried looking for relative posts but couldn’t find anything so any help would be much appreciated.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Does it do this to your posts as well or just pages?

    Is your site set up as domain,com or https://www.domain.com on the WP back end?

    Are you using subfolders or subdomains?

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    Thanks for the quick response,

    Yes it does it to both blog posts and pages.

    the site is set up as domain.com

    I am using subfolders as well.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    This is probably to do with your server set up… Do you have anythign in your .htaccess to redirect www to NON www?

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    no i just have the standard set up from when you install multi-site.

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    Very strange, on a sub site when i go to https://www.example.com/page it works, it just takes the www. out but still goes to the page.

    so its only affecting my main site. very weird.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Are sub sites as separate domains, subfolders or subdomains?

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    The sites are mapped to separate domains at a later stage and before being mapped they are subfolders

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Odds are it’s how your master domain is set up on the server end.

    Basically, something BESIDES WordPress says ‘If you come to https://www.domain.com/ANYTHING go to domain.com’

    It’s a poorly configured redirect. Ask your host, or compare DNS settings from the domains that WORK and the ones that DON’T.

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    Contacted them and they basically said it is the .htaccess

    They said put this in it:

    RewriteEngine on
    rewritecond %{http_host} coolexample.com [nc]
    rewriterule (.*)$ https://www.coolexample.com/$1 [r=301,nc]

    I put it in and nothing changed. but not sure if i need to edit part of the wordpress multi-user htaccess part.

    Feels like iam going round in circles.

    Any help would be much appreciated.

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    I also believe its something with the htaccess file as other websites on the server prior to Multi user websites are working perfectly with the www. and none www.

    This is currently my htaccess file

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    That .htaccess is fine for SubFolder Multisite.

    This code:

    RewriteEngine on
    rewritecond %{http_host} coolexample.com [nc]
    rewriterule (.*)$ https://www.coolexample.com/$1 [r=301,nc]

    Says ‘Anytime someone comes to coolexample.com/<whatever> we should send them to https://WWW.coolexample.com/<whatever>&#8217; which … is correct. That is what you would want. BUT, and here is why I think you’ve got a problem with your host, the DEFAULT behavior of a well configured web-server is this: https://www.coolexample.com/foo and coolexample.com/foo point to the SAME page.

    I would think that if it’s NOT doing that, then something is incorrect on the SERVER level or the DNS level.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Followup. Try this one instead, though:

    # permanently redirect from www domain to non-www domain
    RewriteEngine on
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^domain\.tld$ [NC]
    RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L]
    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    Nah still not working, i will re-contact godaddy

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    This is the reply i just got.

    Thank you for your reply. I apologize for any confusion, however, this is not an issue with your DNS settings. I have thoroughly checked the DNS settings of your domain name and they are set properly. It ap;ears you have a redirect set up that causes the www version of your domain to automatically redirect to youronlinecenter.com without www applied. I apologize for the confusion once again, however, this is not a DNS issue nor a server issue. This is definitely an issue with a redirect set on the website, possibly in your .htaccess file as previously stated.

    Please note that we are unable to support third party application issues and we do not support the inner functionality of this program. If you are having difficulty using a third party product, we can help troubleshoot that process to the point that we find that the issue lies entirely within the configuration of that product. If you believe the issue is caused by something within our system please reply with as much pertinent information as possible and we will further review the issue.

    Please let us know if we can help you in any other way.

    Thread Starter YourOnlineCenter

    (@youronlinecenter)

    Hi Ipstenu,

    Just wondering if there is anything we can do about this as its very weird and just want it sorted.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘When using www. to get to a page redirects to homepage’ is closed to new replies.