Welcome Guest, Not a member yet? Register   Sign In
Unusual Situation: Non-CI subfolder within CI - how to access it directly?
#1

[eluser]behdesign[/eluser]
I have an unusual situation - I'm replacing the admin interface of a website with CI-based code. As I'm replacing the interface, I'm ajaxing in all of the CI forms, etc from CI. In order to get around cross-domain issues, I've decided to put the existing admin code and CI together in the same subdomain, with CI in a subfolder.

The problem is this: that the existing admin code uses a very crude cookie-based authentication, and any ajax request to get to CI is redirected by the existing code to a login screen.

So I thought perhaps I could flip the script: put CI in the root of the subdomain, and the admin code in an /admin subdirectory off the root. The question is: how do I alter the .htaccess (or CI) to let requests to the /admin subdirectory go through?
#2

[eluser]Nir Gavish[/eluser]
please post your current .htaccess file, see what i can do
#3

[eluser]behdesign[/eluser]
Actually, I just gave it a whirl and with the basic .htaccess to clean up CI, it works fine - as long as the request goes to a valid file in the /admin folder, the request is fine.
#4

[eluser]danmontgomery[/eluser]
Code:
RewriteEngine On
RewriteBase /
RewriteCond $1 ^(file1|folder2|folder3)
RewriteRule ^(.*)$ - [PT,L]

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]

Where the first line is a list of files/folders not to rewrite... So, yours could look something like:

Code:
RewriteEngine On
RewriteBase /
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|admin)
RewriteRule ^(.*)$ - [PT,L]

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]

[edit]

^^ or that Wink




Theme © iAndrew 2016 - Forum software by © MyBB