Welcome Guest, Not a member yet? Register   Sign In
New to code Igniter Project
#1

[eluser]revanth[/eluser]
Hi,

I am developing a project in codeigniter. I am getting some problem plz help me. The problem is

here is the url of the project

http://localhost/wigscodeig/ here is the url when i am doing this i am getting my project but when i go into the links
and when i am going into the subcategories the url is

http://localhost/wigscodeig/wigs/subcategories/3

i am getting an error as page not found

here my controller name is wigs and in that i had a function with subcategories but it getting not found plz help me in that situation
#2

[eluser]n0xie[/eluser]
Does this work?
Code:
http://localhost/wigscodeig/index.php/wigs/subcategories/3
#3

[eluser]revanth[/eluser]
<?php
class Wigs extends Controller {

function Wigs()
{
parent:: Controller();
//$this->load->helper('url');
$this->load->model('wigsmodel');
$wigs['title'] = ":: VGS Resource ::";
$wigs['categories'] = $this->wigsmodel->getcategories();
$this->load->view('header', $wigs);
}
function index()
{
$this->load->view('wigsview');
}
function subcategories($id)
{
$this->load->view('subcategories');
}

}
?>

this is my controller function i just tried wheter it works or not it doesn't work

and if the url ls like this it was working

http://localhost/wigscodeig/index.php/wi...tegories/1
#4

[eluser]stommert[/eluser]
do you have a .htaccess file in your site root?
#5

[eluser]revanth[/eluser]
No I does not have any htaccess file in root directory
#6

[eluser]stommert[/eluser]
Hi,

What you probably did was changing
Code:
$config['index_page'] = 'index.php';
for
Code:
$config['index_page'] = '';
but forgot to place a .htaccess file in your siteroot containing
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

you might want to read op on this topic
I hope this does the trick.
#7

[eluser]revanth[/eluser]
no i wasn't removed the index.php in $config['index_page'] = ''; this line
#8

[eluser]stommert[/eluser]
Why do you expect this
Code:
http://localhost/wigscodeig/wigs/subcategories/3
to work then?
If you want that to work then you have to change your config and place the .htacces file in your siteroot. Else you just have to work with this
Code:
http://localhost/index.php/wigscodeig/wigs/subcategories/3
#9

[eluser]revanth[/eluser]
k thanq for this suggestion why i expect that one is for i dont want to have index.php in my url
#10

[eluser]Unknown[/eluser]
All you need is to follow this tutorial, which I find the only one that really works for me:
Removing index.php and setting the .htaccess file




Theme © iAndrew 2016 - Forum software by © MyBB