Please help newbie with <IfModule mod_rewrite.c>

Discussion in 'Apache' started by mikey2007, Jan 24, 2007.

  1. #1
    Hello all,

    I did a search on this but couldnt come up with anything.

    I installed wordpress onto my existing site and it rewrote my htaccess file, and basically killed my google traffic.

    I looked and cant see the problem, should I just hang tough a little longer? any ideas?

    thnx in advance


    RewriteEngine On
    RewriteBase /
    #
    RewriteCond %{HTTP_HOST} ^mysite\.net [NC]
    RewriteRule (.*) http://www.mysite.net/$1 [R=301,L]
    #
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
     
    mikey2007, Jan 24, 2007 IP
  2. JRBHosting

    JRBHosting Peon

    Messages:
    121
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Lets break this down...

    RewriteEngine On
    Code (markup):
    This turns on mod_rewrite
    RewriteBase /
    Code (markup):
    Tells mod_rewrite where to base its commands off of
    RewriteRule (.*) http://www.mysite.net/$1 [R=301,L]
    Code (markup):
    This tells the server to take all traffic to your site and redirect it to a more SEO-friendly URL (http://www.mysite.net/URLGOESHERE), leading it there with a SEO-friendly redirect (301)
    <IfModule mod_rewrite.c>
    Code (markup):
    Checks to see if mod_rewrite exists
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ./index.php [L]
    Code (markup):
    Tells the server to take all nonexistant pages that are accessed and redirect them to ./index.php

    Jason
     
    JRBHosting, Feb 4, 2007 IP