Need help understanding contents of a .htaccess file

I’m working on a blog using WordPress and I can’t figure out what the .htaccess file it creates is doing.

Here is the contents of the file:

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

Does anyone who understands this have the time to explain each line to me? Any help will be greatly appreciated.

Related posts

1 comment

  1. # If the mod_rewrite.c module is available then do the following
    <IfModule mod_rewrite.c>
    
        # Enable the rewrite engine, which is used to rewrite the
        # path to something WordPress understands
        RewriteEngine On
    
        # Set the base to this path. In other words, assume that the
        # website is always at domain.com/welg/
        RewriteBase /welg/
    
        # If index.php is called then stop rewriting ([L] means Last)
        RewriteRule ^index.php$ - [L]
    
        # If the path is NOT a valid file
        RewriteCond %{REQUEST_FILENAME} !-f
    
        # ... and the path is NOT a valid folder
        RewriteCond %{REQUEST_FILENAME} !-d
    
        # ... then always load the index.php file (which will handle
        # loading the page, no matter what the path is)
        RewriteRule . /welg/index.php [L]
    
    # Done
    </IfModule>
    

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

Comments are closed.