Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Currently I have a root wordpress installation at www.mysite.com.

I've added a new folder /store in the root and added in a blank html. However, I can't seem to access the folder by going to www.mysite.com/store.

Any idea how I can do this?

*Update*

I realised when I'd encountered this issue there was no .htaccess file.

It seems like after I've added the .htaccess with a rewriterule to index.php, it all works.

How does wordpress exactly do it's rewrites without a .htaccess in the first place?

share|improve this question
    
can you access the file by naming it? like http://site.com/store/index.html ? –  Sisir Jan 30 '12 at 9:27
    
@Sisir yes, after I added a .htaccess to rewrite all incoming uris to /index.php –  mitsukare Jan 30 '12 at 17:02
add comment

1 Answer

up vote 1 down vote accepted

I don't know why you couldn't access the folder. Maybe you wanna check your .htaccess file first. The default rewrite conditions for apache created by WordPress should include the following two lines, which prevents the redirecting to index.php if a physical file or directory is found.

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d

You could force a redirect with another rewrite condition for your directory, but this should not be necessary.

E.g.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/store/(.*)$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
</IfModule>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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