I have multiple CI applications with two index files in the main directory of the CI project that point to the application directory(indexl.php && oglasnik.php). I have allready written a question about this problem before here.
What I would want to do is to route every request that goes to oglasnik to oglasnik.php.
Here is my .htacces file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /PublishWall/
DirectoryIndex indexl.php
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ indexl.php?/$1 [L]
RewriteCond $1 !^(indexl\.php|oglasnik\.php|images|robots\.txt)
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ indexl.php?/$1 [L]
RewriteRule ^oglasnik$ oglasnik.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
php_value date.timezone "Europe/Ljubljana"
AddDefaultCharset utf-8
RewriteRule ^oglasnik$ oglasnik.php [L] This should rewrite to oglasnik to oglasnik.php and it does, but when it does it points directly to the 404_override instead of the default controller, which is set OK, its works when I type locahost/PublishWall/oglasnik.php.
The rewrite log of the request:
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] strip per-dir prefix: C:/wamp/www/PublishWall/oglasnik -> oglasnik
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] applying pattern '^(.*)$' to uri 'oglasnik'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (4) [perdir C:/wamp/www/PublishWall/] RewriteCond: input='/PublishWall/oglasnik' pattern='^system.*' => not-matched
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] strip per-dir prefix: C:/wamp/www/PublishWall/oglasnik -> oglasnik
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] applying pattern '^(.*)$' to uri 'oglasnik'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (4) [perdir C:/wamp/www/PublishWall/] RewriteCond: input='oglasnik' pattern='!^(indexl\.php|oglasnik\.php|images|robots\.txt)' => matched
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (4) [perdir C:/wamp/www/PublishWall/] RewriteCond: input='/PublishWall/oglasnik' pattern='^application.*' => not-matched
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] strip per-dir prefix: C:/wamp/www/PublishWall/oglasnik -> oglasnik
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] applying pattern '^oglasnik$' to uri 'oglasnik'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (2) [perdir C:/wamp/www/PublishWall/] rewrite 'oglasnik' -> 'oglasnik.php'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (3) [perdir C:/wamp/www/PublishWall/] add per-dir prefix: oglasnik.php -> C:/wamp/www/PublishWall/oglasnik.php
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (2) [perdir C:/wamp/www/PublishWall/] trying to replace prefix C:/wamp/www/PublishWall/ with /PublishWall/
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (4) add subst prefix: oglasnik.php -> /PublishWall/oglasnik.php
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#16bb100/initial] (1) [perdir C:/wamp/www/PublishWall/] internal redirect with /PublishWall/oglasnik.php [INTERNAL REDIRECT]
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (3) [perdir C:/wamp/www/PublishWall/] strip per-dir prefix: C:/wamp/www/PublishWall/oglasnik.php -> oglasnik.php
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (3) [perdir C:/wamp/www/PublishWall/] applying pattern '^(.*)$' to uri 'oglasnik.php'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (4) [perdir C:/wamp/www/PublishWall/] RewriteCond: input='/PublishWall/oglasnik.php' pattern='^system.*' => not-matched
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (3) [perdir C:/wamp/www/PublishWall/] strip per-dir prefix: C:/wamp/www/PublishWall/oglasnik.php -> oglasnik.php
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (3) [perdir C:/wamp/www/PublishWall/] applying pattern '^(.*)$' to uri 'oglasnik.php'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (4) [perdir C:/wamp/www/PublishWall/] RewriteCond: input='oglasnik.php' pattern='!^(indexl\.php|oglasnik\.php|images|robots\.txt)' => not-matched
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (3) [perdir C:/wamp/www/PublishWall/] strip per-dir prefix: C:/wamp/www/PublishWall/oglasnik.php -> oglasnik.php
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (3) [perdir C:/wamp/www/PublishWall/] applying pattern '^oglasnik$' to uri 'oglasnik.php'
127.0.0.1 - - [31/Jan/2013:07:14:48 +0100] [localhost/sid#841d38][rid#173b580/initial/redir#1] (1) [perdir C:/wamp/www/PublishWall/] pass through C:/wamp/www/PublishWall/oglasnik.php
This should work, I think? But it does not. What does this pass through mean in the end of log, it happens also when I acces index.php which works fine.