• Resolved manansaini

    (@manansaini)


    Hello guys,

    I really messed up from last one week with this problem. try a lot search on this forum and others. But problems unable to resolve.

    Lemme explain the situation.

    I have website https://www.logicmatters.org and wordpress MU is installed currently.

    During configuration I used “www” for my site links and I want my works with and without www and all without www links auto redirected to with www.****

    Now all links on my site are working fine with “www” and whenever i tried to access the link without “www” it just redirect to main page.

    Redirection is really a big problem in wordpress. ??

    Can anyone tell me why this happens and how we can resolve this problem.

    I want all links on my site works with and without “www” and even if someone type the link without “www” it automatic redirect to links which has “www”

    I hope Problem is clear ? and yes I used sub directories for WPMU and in .htaccess there is only WP code which WP provides us when we setup Multisite.

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

    (@ipstenu)

    ?????? Advisor and Activist

    Put this above your wordpress code in .htaccess

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example.com$
    RewriteRule (.*) https://www.example.com$1 [R=301]
    Thread Starter manansaini

    (@manansaini)

    I already tried.

    Now again i added this code but no use:

    this is what i added:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^logicmatters.org$
    RewriteRule (.*) https://www.logicmatters.org$1 [R=301]

    My problem is not with only home page, Its realted all links of website.

    Thread Starter manansaini

    (@manansaini)

    If you open site with or without www its always redirect you to link with www.

    Its same concept as other other links, because links without “www” not working so forcely redirect us to main link with www.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    If you open site with or without www its always redirect you to link with www.

    That’s what the code I have you does. Works on hundreds of servers. Did you put it ABOVE the wordpress stuff?

    What plugins are you running? Can you turn them off and test?

    Thread Starter manansaini

    (@manansaini)

    If you open site with or without www its always redirect you to link with www.

    Its also works without that code. I write it in reference to other lines that i mentioned in previous post.

    Btw i have only contact page7 ,Page Links To and akismet plugin i tired by disabling all.

    I only want links with “www” does not matter user enter with or without www. ?? with www is ok but not working without www.

    This .htaccess content:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^logicmatters.org$
    RewriteRule (.*) https://www.logicmatters.org$1 [R=301]
    
    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]
    Thread Starter manansaini

    (@manansaini)

    Wow I fixed it.
    I changed the code in this pattern :

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

    Now its working perfectly ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Huh. I’m going to have to experiment why your host is set up that way. Some of them parse htaccess a little differently, but they shouldn’t need to escape the . there.

    Thank you, thank you, thank you!

    I was having the same problem and it was doing my head in until now. Just for the record, the code format that Manansaini posted worked for me.

    heyyy thanx for you ?? ,, I got solbing my problem for some weeks agoo!! ??
    now wordpress-information.tk redirect to https://www.wordpress-information.tk automaticly ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WordPress Multisite links only works with "www"’ is closed to new replies.