Welcome Guest, Not a member yet? Register   Sign In
RewriteRule fails when index.php is in sub-directory
#3

[eluser]tarsusc81[/eluser]
Aha! I did not fully understand that the "$1" in the RewriteCond is actually a reference to the capturing group from the RewriteRule. (Since RewriteCond comes first, I didn't know the pattern match is actually the first thing to be processed.)

Therefore, I needed one capturing group in the regex pattern for the RewriteCond to operate on, and a second for the RewriteRule to reference.

This works:

Code:
RewriteCond $1 !^codeigniter/index\.php
RewriteRule ^(codeigniter/(.*))$ /codeigniter/index.php/$2 [L]

Bingo bango! Now my whole CodeIgniter site sits in a sub-directory, and all other URLs are none the wiser.

So, thanks for . . . listening, I guess! Maybe my learning process here will help someone else.


Messages In This Thread
RewriteRule fails when index.php is in sub-directory - by El Forum - 12-09-2009, 09:42 AM
RewriteRule fails when index.php is in sub-directory - by El Forum - 12-09-2009, 10:00 AM
RewriteRule fails when index.php is in sub-directory - by El Forum - 12-09-2009, 10:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB