WordPress.org

Ready to get started?Download WordPress

Forums

2.3 Canonical redirects not working as expected (1 post)

  1. JRGould
    Member
    Posted 6 years ago #

    I installed wordpress into a subdirectory of my site /wp_dev/ and later moved the index.php so that users could access wordpress from the root of my site (as described in the Giving WordPress its Own Directory While Leaving the WordPress Index File in the Root Directory" portion of http://codex.wordpress.org/Moving_WordPress) and everything works great except when people link to an old url such as "http://thedistrictweekly.com/wp_dev/staff-infection" rather than redirecting the user (and hopefully sending a 301) to "http://thedistrictweekly.com/staff-infection" the user is simply served the proper content under the wrong URL. You can actually prepend the url with anything "http://thedistrictweekly.com/sdfgjkasdfasdf/staff-infection" would even would

    As far as I understand it the user should be redirected, am I wrong in my expectations, or is my installation working improperly?

    for reference here is the .htaccess that is placed in the root of my site

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
    RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$
    RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp_dev/wp-content/cache/supercache/%{HTTP_HOST}/$1index.html.gz -f
    RewriteRule ^(.*) /wp_dev/wp-content/cache/supercache/%{HTTP_HOST}/$1index.html.gz [L]
    
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress

    the top portion is provided with the WP Super Cache plugin however, I was experiencing this behavior before installing this plugin and modifying the .htaccess file

    Thanks so much for all your help
    -Jeff

Topic Closed

This topic has been closed to new replies.

About this Topic