Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter URLs F1 F1 F1 F1 plz:not solved yet
#1

[eluser]nirbhab[/eluser]
hello frndz

i have recently uploaded CI on a webserver.
but facing typical problem, CI is working perfectly on my localhost.

few point to know abt my config:

config 1: [system/application/config/config.php]

$config['url_suffix'] = "";

config 2: [system/application/config/config.php]

$config['url_suffix'] = ".html";

the way i access resources:

www.your-site.com/index.php/news/article/my_article

note: i have read the manual
second, i am not using .htaccess and please don't tell me to access it.

test url: PLEASE CHECK THE TEST URLS.

when using config 1:

http://cdcg.in/mvc/index.php/blog

when using config 2: [currently config 1 is working thats why u cann't access second one]
http://cdcg.in/mvc/index.php/blog.html

second configration is working but i wanna knw why first one is not working?
as it is working perfectly on my local server.

i even studed index.php

it has following line which explains the EXTENSION .php to be used while using MVC framework.

please help me out :-(
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
#2

[eluser]tonanbarbarian[/eluser]
ok i am a little confused by what the problem is

if you have
Code:
$config[’url_suffix’] = '.html';
then all of the urls will have to have .html on the end of them
I think the site_url function from the url helper will automatically add them on for you

so if you do not want the .html extension then change the config back to
Code:
$config[’url_suffix’] = '';

and because you are not using .htaccess then you will of course need
Code:
$config['index_page'] = 'index.php';

currently when I go to
http://cdcg.in/mvc/index.php/blog.html

I get a ".php" followed by a CI error page indicating that the page cannot be found. Most likely this is because you do not have a blog controller?

not sure if i am misunderstanding the problem though
#3

[eluser]nirbhab[/eluser]
sorry i was not able to make my point enough clear, but i think u r heading towards the right direction.

currently i am using first configuration:
i.e.
$config['url_suffix'] = '';
so URL must wrk like following
http://cdcg.in/mvc/index.php/blog

following file is present in
[system/application/controllers]
<?php
class Blog extends Controller {

function index()
{
echo 'Hello World!';
}
}
?>
#4

[eluser]tonanbarbarian[/eluser]
I do not see how you can be using the config option as specified

If I go to http://cdcg.in/mvc/index.php I see a page that indicates that CI is basically working correctly.
I think you need to confirm that the config.php and controllers/blog.php files have been uploaded correctly

oh and just in case...
if you have both version of the option being set in the config file make sure the one you are not using is remed out correctly
i.e.
Code:
$config[’url_suffix’] = ‘’;
//$config[’url_suffix’] = ‘.html’;
#5

[eluser]nirbhab[/eluser]
the folder 'mvc' in wwwroot of my local webserver is working perfectly fine.
i have re-checked the points you mentioned
i haven't missed any of the configurations in CI, i know that CI i.e index.php is working well , even the files are uploaded properly.

major point to note: that the same configrations are working well on my localhost.

even i am confused why this is happening?
#6

[eluser]tonanbarbarian[/eluser]
who is your hosting provider?
It probably wont help me diagnose but I have seen some people talking about problems with some hosts
if you are not using .htaccess did you upload that or not? if so try deleting it maybe
#7

[eluser]nirbhab[/eluser]
this hosting is provided by serversindia by our company, we usually test our code here
i can't access .htaccess nor i have uploaded any file on this server.
Even i think is a server side problem but i have to solve in CI or its configurations so that i am able to access my controllers.
#8

[eluser]tonanbarbarian[/eluser]
ok well the next thing I would do is this

edit the index.php and add this at the end
Code:
echo '<pre>'.print_r(get_included_files(), true).'</pre>';

Then go to the url that is sort of working...
http://cdcg.in/mvc/index.php/blog.html

This will display all of the files that are included
Check the paths to make sure they are what you expect
then i would suggest trying to trace through the code and see if you can find where it is going wrong.
#9

[eluser]wiredesignz[/eluser]
http://cdcg.in/mvc/index.php?blog

works!!!

The dreaded index page error again. Try:

Code:
$config['index_page'] = 'index.php?';
#10

[eluser]nirbhab[/eluser]
i have loaded the second configrations

$config['url_suffix'] = '.html';
now check the following URLs:

http://cdcg.in/mvc/index.php/blog.html
and
http://cdcg.in/mvc/index.php/blog




Theme © iAndrew 2016 - Forum software by © MyBB