• My site keeps redirecting to the homepage if I do not use www.

    It works when using www.

    Here is the site: bit.ly/Y8YSpP

    I’ve tried editing the .htaccess file. Here is what I have:

    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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Already tried using default theme, disabling all plugins, and resetting permalinks.

    What else can I try?

    Thanks!

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

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    When you activated multisite, there was a notice about how you should NOT use www in your domain.

    Toss this on the top of your .htaccess to force www:

    # Redirect non-www urls to www
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    Thread Starter Tech 790

    (@skytech)

    This worked perfectly! Exactly what I was searching for..

    Thank you!

    Thread Starter Tech 790

    (@skytech)

    There is a different issue now. I can’t access the menu when I use /wp-admin. It redirects to another directory.

    I know I can log in with wp-login.php, but I need wp-admin to work.

    Please help.

    Thanks

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    It redirects to another directory.

    What directory?

    Thread Starter Tech 790

    (@skytech)

    Click on the link then type in /wp-admin at the end. It takes you to home/mysite/public_html/wp-admin

    bit.ly/Y8YSpP

    Thanks

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    How in the world did you do that….

    Is that your WHOLE .htaccess file up there?

    Thread Starter Tech 790

    (@skytech)

    Here is what I currently have:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mysite\.com [NC]
    RewriteRule (.*) http://www.mysite.com/$1 [R=301,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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Search your database for /public_html/ would you?

    Thread Starter Tech 790

    (@skytech)

    What information do you need?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Does /public_html/ show up ANYWHERE in the DB? Cause it never should 🙂

    Thread Starter Tech 790

    (@skytech)

    It shows up on wp options -> _transient_dirsize_cache

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    … That’s it? Uh. Okay, I’m inclined to point the finger at your server, cause WP can’t magically insert that stuff without beint told.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘wordpress MU site redirects to homepage without www.’ is closed to new replies.