WordPress.org

Support

Support » Multisite » wordpress MU site redirects to homepage without www.

wordpress MU site redirects to homepage without www.

  • 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)
  • 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]

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

    Thank you!

    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

    It redirects to another directory.

    What directory?

    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

    How in the world did you do that….

    Is that your WHOLE .htaccess file up there?

    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]

    Search your database for /public_html/ would you?

    What information do you need?

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

    It shows up on wp options -> _transient_dirsize_cache

    … 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.