Welcome Guest, Not a member yet? Register   Sign In
the rule: /class/function/ID is not working in my site
#1

[eluser]sabangel[/eluser]
I am building a Codeigniter site in the subdirectory "site".
I edited /config/routes to set my default controller called main. If I try

mysite.com/site/

It goes ok! The method "index" of the "main" controller is called as waited. However it does not accept neither methods nor controllers that I request explicity. For instance:

mysite.com/site/index.php/main/ not work
mysite.com/site/index.php/blog/entries/ not work

I have not enabled query strings. Do you have some idea about solving this issue?

I'd really appreciate your help.
#2

[eluser]Ben Edmunds[/eluser]
Does mysite.com/site/main/ or mysite.com/blog/entries/ work?
#3

[eluser]sabangel[/eluser]
Hello, when I try:
mysite.com/site/main/

The server say:
"The requested URL /main was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

but if I try:
mysite.com/index.php/main/
or
mysite.com/index.php/blog/entries/

"No input file specified" is showed.
#4

[eluser]bretticus[/eluser]
Can you post your config file? If you are using rewrite (.htaccess) can you post that also?

Thanks
#5

[eluser]sabangel[/eluser]
In /config/config I just changed this directives:

$config['base_url'] = "http://mysite/site/";
$config['uri_protocol'] = "ORIG_PATH_INFO";

There are an ".htaccess" file in a directory called "stats" but I can't edit it (server is administrated by three party).
That ".htaccess" just contains the string:
Options +Indexes

Should I create my own .htacces?

Thanks !
#6

[eluser]bretticus[/eluser]
[quote author="sabangel" date="1254464459"]In /config/config I just changed this directives:

$config['base_url'] = "http://mysite/site/";
$config['uri_protocol'] = "ORIG_PATH_INFO";

[/quote]

Have you tried changing $config['uri_protocol'] to "AUTO"?

[quote author="sabangel" date="1254464459"]

There are an ".htaccess" file in a directory called "stats" but I can't edit it (server is administrated by three party).
That ".htaccess" just contains the string:
Options +Indexes
[/quote]

This would be an .htaccess file that you are using for making the urls "pretty." Obviously, you don't have apache rewrite in place if you didn't make one. Check and make sure that $config['index_page'] is set to "index.php";

[quote author="sabangel" date="1254464459"]
Should I create my own .htacces?[/quote]

You are not required to, but you may want to take index.php out of the urls so they look more natural (and are not so obviously a framework using PHP. Not that security through obscurity was ever really a great alternative.) Look in the manual and the wikis for more information if you are interested.
#7

[eluser]sabangel[/eluser]
I had to change that directive because the site didn't work at all.
neither AUTO nor PATH_INFO worked. The others options do work but still with the problem above mentioned.
#8

[eluser]sabangel[/eluser]
Hello.
I tell this in case somebody has the similar problem.
It seems the proble was solved just puting "?" after index.php in the URL. When I write index.php? intead index.php, It does not matter what is set in the directive $config[‘base_url’]. I don't know exactly the why??
Does somebody can clear this out?

thanks
#9

[eluser]Colin Williams[/eluser]
Probably an old version of Apache, or one configured in a peculiar way. You can always do a phpinfo() and look at the server variables. Find the one that looks like /path/to/load and then tell CI to use that var.




Theme © iAndrew 2016 - Forum software by © MyBB