WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] When using www. to get to a page redirects to homepage (23 posts)

  1. YourOnlineCenter
    Member
    Posted 3 years ago #

    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 http://example.com/page it shows but when i try to use http://www.example.com/page it redirects me to the homepage at http://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.

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

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

    Are you using subfolders or subdomains?

  3. YourOnlineCenter
    Member
    Posted 3 years ago #

    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.

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

  5. YourOnlineCenter
    Member
    Posted 3 years ago #

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

  6. YourOnlineCenter
    Member
    Posted 3 years ago #

    Very strange, on a sub site when i go to http://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.

  7. Are sub sites as separate domains, subfolders or subdomains?

  8. YourOnlineCenter
    Member
    Posted 3 years ago #

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

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

    Basically, something BESIDES WordPress says 'If you come to http://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.

  10. YourOnlineCenter
    Member
    Posted 3 years ago #

    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 (.*)$ http://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.

  11. YourOnlineCenter
    Member
    Posted 3 years ago #

    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
  12. That .htaccess is fine for SubFolder Multisite.

    This code:

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

    Says 'Anytime someone comes to coolexample.com/<whatever> we should send them to http://WWW.coolexample.com/<whatever>;' 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: http://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.

  13. 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 ^(.*)$ http://www.domain.tld/$1 [R=301,L]
  14. YourOnlineCenter
    Member
    Posted 3 years ago #

    Nah still not working, i will re-contact godaddy

  15. YourOnlineCenter
    Member
    Posted 3 years ago #

    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.

  16. YourOnlineCenter
    Member
    Posted 3 years ago #

    Hi Ipstenu,

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

  17. Sorry, I was out and about this weekend (Passover is tomorrow night!!!)

    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.

    God I hate GoDaddy. That's exactly right but WHERE?

    Check in your wp-config.php file and see what the domain is saved as in the Multisite section there?

  18. YourOnlineCenter
    Member
    Posted 3 years ago #

    ok do u mean this part?

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'youronlinecenter.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    define( 'SUNRISE', 'on' );
  19. I did!

    define( 'DOMAIN_CURRENT_SITE', 'youronlinecenter.com' );

    SOME times you need to define that as http://www.yourdmoain.com :/

    You can try it, but it may not work.

  20. YourOnlineCenter
    Member
    Posted 3 years ago #

    no luck :(

    It made it worse, lol. the site pages wouldnt show and the pages just kept redirecting to the homepage with no www. and just trying to get to the pages became impossible with that on.

  21. gabrieldoty
    Member
    Posted 2 years ago #

    I know this is old - but just wanted to follow up and let you know that i had this same issue and it appears to be an issue with the plugin "Remove /blog slug plugin for wpmu" - if you have that installed, try disabling and then resaving your permalinks and see if that fixes it.

  22. stimsonm
    Member
    Posted 2 years ago #

    did you get this issue fixed, I'm having the exact issue and my host (mediatemple) said it was an htaccess issue

  23. esmi
    Forum Moderator
    Posted 2 years ago #

    Please post a new topic.

Topic Closed

This topic has been closed to new replies.

About this Topic