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 CakePHP 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 permalinks 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!

You should be able to add a rewrite condition to prevent WordPress from taking over the URLs for tracker: RewriteCond %{REQUEST_URI} !tracker/

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !tracker/
    RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^wp-admin/profile\.php$  /ssm/welcome [R] 
</IfModule>

It's not exactly what you are looking for but... You could simply create an add-on domain for your "tracker" application. It could be exactly the same in your www/ directory, you gonna have the example.com/ and the tracker/ directory, the only difference is you gonna have to access the application with something like this : http://tracker.example.com/...

That could solve your problem as add-on domains are treated like independent websites inside of a domain. And i guess every shared hosting plan let you create an infinite amount of add-on domains for free :P

  • This is the current work around. Thanks for the suggestion! – John Keippel Dec 15 '12 at 6:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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