last day (15 days later) » 

21:52
2
Q: Code Igniter Project Folder

JaydenI have a code igniter project folder. Everything works fine. But when i placed the project folder in another folder as a sub-folder, i get 404 Page Not Found for the Controller URLS i called. For instance the CI url is http://localhost/library Then i place it in another folder like : http://loca...

Post your .htaccess file in the question
RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Is there a .htaccess file in the school folder? also, did you change your index_page config?
There is no .htaccess in the school folder. I don't get the second part of the question.
I mean you need to set index_page to a blank value in application/config/config.php. This is really weird as you don't have to change the index_page in order for it to work. Is there anything else in your .htaccess file other than the content I gave you in the answer? is mod_rewrite enabled in your server? can you tell me the path you are trying to access that gives you the 404 error?
21:52
There is nothing else inside the .htaccess apart from what you mentioned. I am trying to access localhost/school/library/home/login. But when i access it like this localhost/library/home/login. It works fine.
Do you have mod_rewrite enabled? what operating system are you using?
I am using Windows
But it will be uploaded onto a linux server
When you access "localhost/school/library/" does it work?
Yes it does
What about "localhost/school/library/assets"?
21:57
yeah it works
Also what is the default controller, is it still welcome? can you post in your question the Home controller ( just the index method and construct if any, not the whole file if it's large)
Yes default is welcome
But i am using a third party MX
A third party MX? did you post your controller
class home extends CI_Controller {

public function __construct() {
parent::__construct();
$this->load->library('form_validation');
$this->load->helper('form');
}

public function login() {
$this->load->model('auth_model');
if ($this->input->post('submit')) {
$config = array(
array(
"field" => "username",
"label" => "Username",
"rules" => "required"
),
array(
"field" => "password",
"label" => "Password",
"rules" => "required"
)
);
$this->form_validation->set_rules($config);
$this->form_validation->set_error_delimiters('<li>', '</li>');
That is the home controller
it has no index method
First you need to make h uppercase like this Home and the same goes for the file, it must be Home.php
Also, why are you passing base_url to redirect? you can simply pass the URI to `redirect directly
22:06
Okay
I did what you said
Still did not work
I'm pretty sure you are messing some details, you said accessing "localhost/library/home/login" works fine, but "localhost/school/library/home/login" doesn't. I'm pretty sure you have a problem with the folders, can you post a screenshot of your school folder
Okay
I dont think i can post a picture here right?
You can, there is an "upload" button on the right of the "send" button
Thats the link to the folder content of the school folder
Now post one inside the library folder
This is really driving me crazy... try accessing:
localhost/school/library/index.php
If it works, then try accessing:
localhost/school/library/index.php/home/login
yes
Both worked fine
Can you post your "school/library/.htaccess" again here just to make sure
Okay
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L]
Is mod_rewrite enabled?
What are you using for your localhost?
Wamp? or XAMPP?
or something else*
22:34
Xampp
Create a file in your root folder, name it 'info.php', in that file type:
<?php
phpinfo();
then access localhost/info.php
you will get a page with your server's details
look for mod_rewrite using CTRL+F
can you find it?
Okay
Yes i can
Well here I'm stuck and I have no idea why it doesn't work, can you try restarting apache even though I don't think that'll do any change
How come it works fine with index.php
But without it, it fails
I think there is something wrong with your apache setup, I can't tell for sure as I'm not using XAMPP nor Windows. Have you tried uploading it to a server? and did it work?
By the way which CodeIgniter version are you using?
23:04
I have not tried
the version is 2.2.0
I'm not sure how you do so in version 2, it's really old.
I think it's the same
23:42
Okay
Well its sad though
Thank you for your time

last day (15 days later) »