mod_rewriting fun with two .htaccess files…one for wordpress and one for CI in a subdirectory – Education Career Blog

I have a weird situation that’s come up, so I’m hoping some one can help me out.

I have a wordpress installation in the root directory and a codeigniter installation in a subdirectory (I know, I know…). Both are working fine on their own. The codeigniter installation has its own .htaccess file for rewriting to index.php.

But what if I wanted a URL outside of the codeigniter directory to rewrite to the codeigniter directory, which will then be rewritten again by the CI .htaccess file.

For example: is a URL used by wordpress. THIS WORKS is the root of codeigniter. THIS WORKS is a CI URL. THIS WORKS

But what if I wanted to point to 

and then have this be properly rewritten by CI?

Is this possible to do without a hard redirect?


In your root directory .htaccess write above the WordPress rules:

RedirectMatch Permanent ^/users/(.*) /codeigniter/users/$1

Leave a Comment