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>

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

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>

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!

link|improve this question

Is there a reason why you need to put the htaccess in the root directory rather than the /blog/ directory? – theotherreceive Dec 1 '11 at 16:52
Because I'm using cs-cart (a shopping cart software by cs-cart.com) at the root directory. – kavoir.com Dec 2 '11 at 2:15
feedback

1 Answer

up vote 0 down vote accepted

Turned out it's a permissions thing that I didn't set up right in Linux. Not a .htaccess problem. So this question is meaningless.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.