Forums

.htaccess file works fine, when I add 301 redirects it loops (3 posts)

  1. joeventura
    Member
    Posted 5 months ago #

    I have WordPress installed in the root, nothing fancy.

    I have the following .htaccess file also in the root.

    It works fine.

    When I add the 301 redirects that appear below after the
    # END WordPress tag - the site stops working and throws redirect loop errors.

    Any ideas? Here is the contents of the file:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^lapband.net [NC]
    RewriteRule ^(.*)$ http://www.lapband.net/$1 [L,R=301]
    
    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .htm .html
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    redirect 301 /bmicalc.html http://www.lapband.net/qualify/
    redirect 301 /contact_us.html http://www.lapband.net/contact-us
    redirect 301 /findlapbandsurgeon.html http://www.lapband.net/find-surgeon.php
    redirect 301 /how-much-weight-am-i-going-to-lose.html http://www.lapband.net/how-much-weight-am-i-going-to-lose/
    redirect 301 /how-to-avoid-gaining-back-the-weight.html http://www.lapband.net/avoiding-gaining-back-the-weight-after-surgery/
    redirect 301 /index.html http://www.lapband.net
    redirect 301 /lapbandarticles.html http://www.lapband.net/category/lapband-questions-and-answers/
    redirect 301 /lapbandcost.html http://www.lapband.net/lap-band-cost/
    redirect 301 /lapbandfaq.html http://www.lapband.net/lap-band-faq/
    redirect 301 /lapbandseminar.html http://www.lapband.net/lapband-seminar.php
    redirect 301 /lapbandsurgeons.html http://www.lapband.net/find-surgeon.php
    redirect 301 /myths-misconceptions-about-the-lapband.html http://www.lapband.net/myths-and-misconceptions-about-the-lap-band/
    redirect 301 /privacy.html http://www.lapband.net/privacy-policy
    redirect 301 /qualifyforlapband.html http://www.lapband.net/qualify/
    redirect 301 /resources.html http://www.lapband.net/lap-band-resources
    redirect 301 /sitemap.html http://www.lapband.net/archives/
    redirect 301 /the-facts-about-lap-band-adjustments.html http://www.lapband.net/the-facts-about-lap-band-adjustments/
    redirect 301 /The-Me-I-always-wanted-to-be.html http://www.lapband.net/the-me-i-always-wanted-to-be/
    redirect 301 /weightlossresults.html http://www.lapband.net/results/
    redirect 301 /blog http://www.lapband.net
    redirect 301 /blog/category/lapband-stories/ http://www.lapband.net/category/lapband-stories/
  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 5 months ago #

    Rule one. Put the redirects at the top, ABOVE the wordpress calls.

    Rule two. Get ride of the index.html redirect.

  3. joeventura
    Member
    Posted 5 months ago #

    Rule three. You are awesome that fixed it.

    Rule Four, Always say Thank you!

    THANKS SO MUCH!!!

Reply

You must log in to post.

About this Topic