Wordpress .htaccess preventing subfolder access

Posted by John K. on Pro Webmasters See other posts from Pro Webmasters or by John K.
Published on 2012-12-14T03:22:03Z Indexed on 2012/12/14 5:20 UTC
Read the original article Hit count: 261

Filed under:
|
|

This is sort of a goofy setup, but it's not in my power to reconfigure it at this time. I'm running in a shared hosting environment.

The domain is example.com. This is an add-on domain on the host side with example.com being redirected to the www/example.com sub-directory. That directory houses a standard Wordpress site which acts as the main site when you visit example.com.

The .htaccess file within that directory is:

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

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wp-admin/profile\.php$  /ssm/welcome [R] 
</IfModule>

I have a subdirectory, at the root level with the /example.com subdirectory that houses a cake php application. That subdirectory is /tracker.

My problem is that when I attempt to browse to example.com/tracker, I get a 404 from Wordpress because perma links are on. What I think I need is a rewrite rule in the Wordpress .htaccess file that short circuits the existing rewrite rules and permits example.com/tracker to work independently of the Wordpress install. Or a rewrite rule at the root level that short circuits the redirect to the /example.com directory in the first place.

Not sure how well I explained that so here's a summary.

The www/ directory structure:

  • example.com/
  • tracker/

Add on domain of www.example.com redirecting to the /example.com directory with Wordpress and a tracker/ directory running CakePHP which I would like to access via www.example.com/tracker.

If you need further info or clarification let me know!

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about Wordpress