Welcome Guest, Not a member yet? Register   Sign In
codeigniter 404 on existing controller
#1

[eluser]Sindhuja[/eluser]
Hi All,

I am facing one unusual server based issue.

I have video.php file in controllers folder. And I used .htaccess to remove index.php and accessing pages like this http://domain-name/page

Here my issue is, except videos page, every other pages are working fine when I access it through URL.

When I try to access the videos page like this http://domain-name/videos, then it will be redirected to http://domain-name/500.shtml

If I try to access the same page like this http://domain-name/videos/myvideos, then it will be redirected to http://domain-name/404.shtml

Class name is same as file name 'Videos'. So no issues in class name.

Also, If I save the videos file in another name and access it, it works fine. I cant understand wats the issue. Particularly it doesn't work in this site server only.

Thanks in advance.
#2

[eluser]2think[/eluser]
Have you checked that there isn't an htaccess rule that looks up videos in something like an images directory off your root?

Have you included an index function in your Video controller? And have you included a myvideos function as well for your second test case (http://domain-name/videos/myvideos)?
#3

[eluser]Sindhuja[/eluser]
In htaccess, everything looks fine. If I disbale the .htaccess and access the same page http://domain-name/index.php/videos, then it works fine.

Also, index and myvideos functions exist in videos file



[quote author="2think" date="1289325292"]Have you checked that there isn't an htaccess rule that looks up videos in something like an images directory off your root?

Have you included an index function in your Video controller? And have you included a myvideos function as well for your second test case (http://domain-name/videos/myvideos)?[/quote]
#4

[eluser]Sindhuja[/eluser]
Also, If I use

$config['uri_protocol'] = "AUTO"; to

$config['uri_protocol'] = "REQUEST_URI";

then http://domain-name/videos works fine. But some other issue occurs like post values.

So 'AUTO' only I have to use
#5

[eluser]Deep Arora[/eluser]
I am facing the same issue, can't use REQUEST_URI. On a server with godaddy, it doesn't work and throws 404 error. Any help?
#6

[eluser]vitoco[/eluser]
if :
- http://domain-name/index.php/videos works, but
- http://domain-name/videos doesn't

i've faced two issues :
1.- the necessary url rewrite doesn't work, cause :
- mod_rewrite it's not enabled > check php_info()
- .htaccess it's writed wrong, try this one
Code:
Options +FollowSymLinks

    RewriteEngine On


    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php/$1 [L]

2.- there some folder called just like the controller, in your case, the dir "/videos" ( http://domain-name/videos/ ) exists.

Saludos




Theme © iAndrew 2016 - Forum software by © MyBB