Welcome Guest, Not a member yet? Register   Sign In
Admin folder in subfolder not working...
#1

Hello guys,
Here's the thing.

I've created the main application in the subdomain sub.domain.com and i've placed another admin ci application in sub.domain.com/admin/.

The problem is that when i'm trying to access the subfolder what i get is a 404 error "not found" page.

Here's the .htaccess of the admin application:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]    

<IfModule mod_rewrite.c>
RewriteEngine on
#
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/admin/"
RewriteRule (.*) $1 [L]
#
</IfModule>

The config.php base_urls: 
Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'https://sub.domain.com/admin/';

/*
|--------------------------------------------------------------------------
| Base site url
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['front_url'] = 'https://sub.domain.com/';



And here's the routes.php (note: I've placed the controllers in subfolders):
Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
* Users login - logout
*/
$route['login']  = 'users/users/login';
$route['logout'] = 'users/users/logout';

/**
* Projects
*/
$route['projects'] = 'projects/projects';
$route['projects/new']    = 'projects/projects/new';
$route['projects/edit/(:any)']     = 'projects/projects/edit/$1';
$route['projects/(:any)'] = 'projects/projects/$1';

/**
* Posts
*/
$route['posts']    = 'posts/posts';
$route['posts/new']= 'posts/posts/new';
$route['posts/edit/(:any)'] = 'posts/posts/edit/$1';
$route['posts/(:any)']     = 'posts/$1';


/**
* Customers
*/
$route['customers'] = 'customers/customers';
$route['customers/(:any)'] = 'customers/customers/$1';
$route['customers/edit/(:any)'] = 'customers/customers/edit/$1';

/**
* Admin users
*/
$route['users'] = 'users/users';
$route['users/(:any)'] = 'users/users/$1';

/**
* Orders
*/
$route['settings/(:any)'] = 'settings/$1';
$route['settings'] = 'settings';


/**
* Redirect any URI after default url
*/
$route['pages/(:any)'] = 'pages/$1';

/**
* Any URI pass
*/
$route['(:any)'] = 'pages';
$route['default_controller'] = 'pages';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

I've searched all over the net and i cant find anything useful.. Thanks...

//Life motto
if (sad() == true) {
     sad().stop();
     develop();
}
Reply


Messages In This Thread
Admin folder in subfolder not working... - by HarrysR - 07-15-2019, 09:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB