Welcome Guest, Not a member yet? Register   Sign In
URI Routing (htaccess) with multiple Applications
#1

[eluser]Lunaticon[/eluser]
Hello CodeIgniter community,

I've got a little Problem with my CodeIgniter. I use two applications in my app folder. The first one is the frontend, the second one the backend.

In my root directory I've two .php files. An index.php leading to the frontend directory and a backend.php leading to the backend directory.

Since I use mod rewrite in order to get clean URL's there is a problem with that. The URL structure is the following: www.domain.com/controller/action

That's the action of the controller in my frontend Application.

I use htacces to get rid of the /index.php/ between domain and controller. To access my backend application I want my URL to be like this www.domain.com/admin/controller/action

therefore I have this rewrite rule:

Code:
RewriteCond %{REQUEST_URI} ^admin.*
RewriteRule ^admin/(.*)$ /backend.php?/$1 [L]

Now the problem: CodeIgniter assumes that /backend/ is the first URI segment, and wants to treat it mistakenly as my controller.

Do I really have to edit the core of CodeIgniter in order to tell it not to use the Server Request URI or is there another trick?

Thanks in advance,
Lunaticon
#2

[eluser]toopay[/eluser]
pre system hook is more elegant way to do that instead hacking a core class like that.




Theme © iAndrew 2016 - Forum software by © MyBB