HELP! 301 redirects in .htaccess file not working!!! 500 internal server error

Discussion in 'Apache' started by mitz, Jun 4, 2010.

  1. #1
    Hi guys
    I am having a problem!!!

    I have moved my old website from frontpage which had .htm and .html extensions to wordpress and changed the permalinks to all .htm

    Now I want to do 301 redirects in the htaccess file and I am getting a 500 internal server error...

    This is what I have before the redirects

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymLinks
    RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
    
    </IfModule>
    
    # END WordPress
    
    Code (markup):
    Then I have redirects

    redirect 301 /Freeware/zip.html http://tips4pc.com/freeware/7zip.htm
    redirect 301 "/internet-tips/Internet_Explorer _8_Add_Change_homepag_tab.htm" http://tips4pc.com/internet-tips/video-internet-explorer-8-add-or-change-a-homepage-tab.htm
    Code (markup):
    I have "" around some urls because there are spaces in the url....

    I have around 50 of them..

    I am trying to change everything around...

    I would really appreciate some help..:)
     
    mitz, Jun 4, 2010 IP
  2. mitz

    mitz Well-Known Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #2
    I had to put this back to get the site working again..

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
     
    mitz, Jun 4, 2010 IP
  3. irving

    irving Peon

    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So are your 301 redirects working properly now?
     
    irving, Jun 4, 2010 IP
  4. mitz

    mitz Well-Known Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    Well I went and found a Wordpress plugin to do it for me...
    I was doing my head in...
    I am not sure if it is better to use the .htaccess file instead though...???
    What do you think?
     
    mitz, Jun 4, 2010 IP
  5. irving

    irving Peon

    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If the plugin is giving you correctly formed 301 redirects, then I would say you're golden.

    Have a look at your .htaccess file, because it's likely the plugin has made changes to your .htaccess anyway.
     
    irving, Jun 4, 2010 IP
  6. ShakataGaNai

    ShakataGaNai Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you need to be more efficient, then .htaccess file will be better (Apache will handle it with much less work than a PHP script). If you don't have that much traffic, then go with what ever works for you.

    Also, next time you have errors: Check/Post the error.log file lines from apache - that will include more detailed information on what is actually wrong with your requests.
     
    ShakataGaNai, Jun 7, 2010 IP