Installing wordpress in sub-directory with another app's .htaccess in root directory

Discussion in 'Site & Server Administration' started by TheDataPlanet.com, Nov 30, 2011.

  1. #1
    So I have a .htaccess at the root directory of example.com:

    DirectoryIndex index.html index.php
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php?sef_rewrite=1 [L,QSA]
    
    </IfModule>
    Code (markup):
    Now I'm installing wordpress at example.com/blog/, but after uploading wordpress files there, it's Page Not Found 404 error when I visit http://www.example.com/blog/

    My take is I should modify the .htaccess in the root directory of example.com or the request is redirected to /index.php rather than /blog/index.php

    This is the line I added into the .htaccess in the root directory:

    RewriteCond %{REQUEST_URI} !^/blog
    Code (markup):
    So the whole thing looks like:

    DirectoryIndex index.html index.php
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
    RewriteCond %{REQUEST_URI} !^/blog
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php?sef_rewrite=1 [L,QSA]
    
    </IfModule>
    Code (markup):
    But it doesn't work. It's still 404 error at example.com/blog/. I thought it should be something like that, right?

    Then how should I modify the .htaccess in the root directory to make this work? Thanks a lot!
     
    TheDataPlanet.com, Nov 30, 2011 IP