Forums

Home page fell into a rewrite loop without provocation (1 post)

  1. KalleP
    Member
    Posted 3 months ago #

    One of my WP sites has a redirect problem, others are fine.

    It started (changed now) off with mysite.com/ causing a redirect loop error in Firefox. Also mysite/wp-admin loads correctly and is working fine.

    It is installed into thte web-root that it shares with its .html ancestor site and is the only site of mine that I have had to edit the .htaccess file to allow togling between the index.html and index.php sites and the legacy 301 redirects.
    All my sites are on a common shared server and all use /%postname%/ permalinks. Most, including this one, only have static pages and have the 'Home' page as the home page. This site needs an upgrade as it is still 2.8.4 so I will not publish the site link here in the open but available if required.

    I read scores of posts and tried a few things that seemed relevant.
    I do not use Redirect plugin
    I have not done an upgrade
    I have no caching
    I have not posted or edited any pages for months
    No hosting changes as far as I know
    Only plugins are WP.com stats and dashboard and ContactForm7
    Deactivating plugins does not make any change
    Re-saved settings/permalinks settings/general
    Removed and restored .htaccess no sign of change

    At some point the redirect look changed to a loading of the legacy .html site, debugging below (no mistakes I hope), ask if you need more informaion to clarify.

    Enter address >>>> redirect/rewrite >>>> page loaded

    When the problem was first spotted yesterday it was not broken for long, site activity has been constant but low.

    mysite.com/ >>>> not checked >>>> redirect loop error
    mysite.com/index.html >>>> not checked >>>> legacy index.html
    mysite.com/index.htm >>>> not checked >>>> redirect loop error
    mysite.com/index.php >>>> not checked >>>> redirect loop error
    mysite.com/home/ >>>> mysite.com/home/ >>>> current WP home page
    mysite.com/oldpage.html >>>> mysite.com/newpermalink/ >>>> correct WP page

    Currently I have
    mysite.com/ >>>> mysite.com/ >>>> legacy index.html
    mysite.com/index.html >>>> mysite.com/index.html >>>> legacy index.html
    mysite.com/index.htm >>>> mysite.com/ >>>> legacy index.html
    mysite.com/index.php >>>> mysite.com/ >>>> legacy index.html
    mysite.com/index.php/?p=2>>>> mysite.com/home/ >>>> current WP home page
    mysite.com/?page_id=2 >>>> mysite.com/?page_id=2 >>>> redirect loop error
    mysite.com/?p=2 >>>> mysite.com/?p=2 >>>> redirect loop error
    mysite.com/home/ >>>> mysite.com/home/ >>>> current WP home page
    mysite.com/oldpage.html >>>> mysite.com/newpermalink/ >>>> correct WP page

    If I activate Disable canonical URL redirection plugin I get the following
    mysite.com/ >>>> mysite.com/ >>>> legacy index.html
    mysite.com/index.html >>>> mysite.com/index.html >>>> legacy index.html
    mysite.com/index.htm >>>> mysite.com/ >>>> legacy index.html
    mysite.com/index.php >>>> mysite.com/index.php >>>> current WP home page
    mysite.com/home/ >>>> mysite.com/home/ >>>> current WP home page
    mysite.com/oldpage.html >>>> mysite.com/newpermalink/ >>>> correct WP page

    If I use the default WP .htaccess there is no 301 rewrite and I get
    mysite.com/ >>>> mysite.com/ >>>> legacy index.html
    mysite.com/index.html >>>> mysite.com/index.html >>>> legacy index.html
    mysite.com/index.htm >>>> mysite.com/index.htm >>>> current WP page not found error
    mysite.com/index.php >>>> mysite.com/index.php >>>> current WP home page
    mysite.com/home/ >>>> mysite.com/home/ >>>> current WP home page
    mysite.com/oldpage.html >>>> mysite.com/oldpage.html >>>> legacy oldpage

    Not sure where all the stuff in the .htaccess has come from, I'm probably responsible for putting it in over the years but no changes for a few years. I think DirectoryIndex was put in when I installed wordpress with the old site so I could switch between them. The AuthName could have something to do with PHPList that has not been touched for 2 years. The IndexIgnore I have no idea :-) This is the only WP site that I have had to edit my .htaccess file from the WP standard.

    # -FrontPage-
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName mysite.com
    AuthUserFile /home/user/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/user/public_html/_vti_pvt/service.grp

    DirectoryIndex index.php index.htm index.html

    Redirect 301 /oldpage.htm http://mysite.com/newpermalink/
    Redirect 301 15 others all working
    Redirect 301 /index.htm http://mysite.com/
    Redirect 301 /index.html http://mysite.com/

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Visitors get the old .html site and the 301 redirects put them onto the new site after the first click but there is a menu structure change and a styling shift that is obvious so not a longterm solution.

    How can I get the canonical name to load the index.php page?

Reply

You must log in to post.

About this Topic