• After upgrading to 3.0 I’m encountering errors when attempting to add a redirect rule to htaccess to redirect non www to www.

    Here is my htaccess after upgrade to 3.0:

    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    and here is the rule I’m trying to add:

    # BEGIN Non WWW Redirect
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^example.com [nc]
    rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]
    # END Non WWW Redirect

    I’ve tried adding this at the top of the other rules and at the bottom.

    I’m getting essentially a “loop” after adding the redirect, such that the URL will never resolve — just bounces back and forth between “example.com” and “www.example.com” and finally (FireFox) says, “Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”

    Any help would be appreciated.

Viewing 1 replies (of 1 total)
  • Even I’m getting an error with a 301 redirect.
    Can someone please help –

    how can I redirect a non www url to www url?

Viewing 1 replies (of 1 total)
  • The topic ‘Errors With htaccess non www to www redirect after upgrade to 3.0’ is closed to new replies.