WordPress.org

Ready to get started?Download WordPress

Forums

wordpress MU site redirects to homepage without www. (13 posts)

  1. Tech 790
    Member
    Posted 1 year ago #

    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!

  2. 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]
  3. Tech 790
    Member
    Posted 1 year ago #

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

    Thank you!

  4. Tech 790
    Member
    Posted 1 year ago #

    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

  5. It redirects to another directory.

    What directory?

  6. Tech 790
    Member
    Posted 1 year ago #

    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

  7. How in the world did you do that....

    Is that your WHOLE .htaccess file up there?

  8. Tech 790
    Member
    Posted 1 year ago #

    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]
  9. Search your database for /public_html/ would you?

  10. Tech 790
    Member
    Posted 1 year ago #

    What information do you need?

  11. Does /public_html/ show up ANYWHERE in the DB? Cause it never should :)

  12. Tech 790
    Member
    Posted 1 year ago #

    It shows up on wp options -> _transient_dirsize_cache

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

Topic Closed

This topic has been closed to new replies.

About this Topic