allow real folder within WordPress hierarchy

New to mod_rewrite? This is a good place to start.

allow real folder within WordPress hierarchy

Postby stvwlf » Sun Oct 04, 2009 5:10 pm

Hi

Have WordPress installed in the root folder. Need to create an actual folder under the root folder with HTML files in it and allow web access to that folder. For sake of example, lets call the actual folder "/folder"

Problem is the WordPress htaccess code is redirecting attempts to access /folder to WP's index.php file, which delivers 404's as WP is not aware of /folder and thinks this is an attempt to access a non-existent WP page.

The WP htaccess code is

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

The WP install is in the root, thus the additional code has to go in this level's htaccess file.

Thank you for your help.
stvwlf
 
Posts: 5
Joined: Sun May 10, 2009 1:49 am

Postby richardk » Mon Oct 05, 2009 8:16 am

Try
Code: Select all
Options +FollowSymLinks

<IfModule mod_rewrite.c>
  RewriteEngine On

  # ...if it's not (!) a request to /folder...
  RewriteCond %{REQUEST_URI} !^/folder(/.*)?$ [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</IfModule>
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby stvwlf » Mon Oct 05, 2009 8:51 am

This worked, thank you
stvwlf
 
Posts: 5
Joined: Sun May 10, 2009 1:49 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 28 guests

cron