Welcome Guest, Not a member yet? Register   Sign In
godaddy / htacces / weird results (yes, i've searched and looked at all the posts!)
#1

[eluser]cityzen[/eluser]
Ok, so I'm having a similar situation with GoDaddy, except mine has no cure it seems. When I set my default controller to something like faqs, that controller index works fine, loads right up. Of course anything I click from there gets me to the infamous "No input file specified." of death.

There are two things at play here...

A)I have CI installed in a subdirectory called "admin" as I'm only using it for the admin/CMS section...

B) I have a controller called "news" and it links via:
http://www.mysite.com/admin/index.php/news
BUT if I click on a link to the news controller, it redirects me to http://www.mysite.com/news.php The url still displays as http://www.mysite.com/admin/index.php/news but the page that shows up is the news.php page on the front end. This is interesting to me saying that something is happening here, but I don't know what.

I have tried to "test" my htaccess file and it seemingly doesn't work as this happens with or without it in my /admin directory or in my webroot. Is there a configuration I'm missing that would indicate to CI that it is installed in /admin? I have these:

Code:
$config['base_url']    = "http://www.mysite.com/admin/";
$config['index_page'] = "index.php?";
$config['uri_protocol']    = "QUERY_STRING";

I believe I've tried all flavors of uri_protocol but will continue to test.

I realy do hope that someone can help me. I'm launching my project this week (late due to this) and getting to the point where I'm out of options. I am hopeful that with the strange redirect and the fact that I can get the default controller to load (which unfortunately looks like it's just by routing in the index.php) that this *may* possibly work.

Thanks to everyone for their help in advance.

mike
#2

[eluser]Crazy LionHeart[/eluser]
If you change sefault CI catalog you must change main 'index.php' like:
Code:
/*
|---------------------------------------------------------------
| SYSTEM FOLDER NAME
|---------------------------------------------------------------
|
| This variable must contain the name of your "system" folder.
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
    $system_folder = "admin";
#3

[eluser]cityzen[/eluser]
Thanks for the response. I didn't actually change the system folder, just put CI in the admin dir so it's admin/system/...

/m
#4

[eluser]Pascal Kriete[/eluser]
Change the system_folder and application_folder use full filesystem paths.

And then check the paths by adding this to the bottom of index.php (right before 'And away we go...'):
Code:
echo 'app-path: '.APPPATH;
echo 'base:'.BASEPATH;
#5

[eluser]cityzen[/eluser]
Ok, so i finally have this thing "working" but I really like to understand how/why it's working rather than saying "ok, cool!".

I can access my pages all by http://www.mysite.com/admin/index.php?/foo/bar/

What's the dilly with the "?" ? I know what a ? does, but i'm not following why that being there is helping?

Also, apparently godaddy caches their htaccess files on an hourly basis, so for those in need of a quick test, godaddy cannot do that according to their own site. I don't recall if anyone posted that in here or I only came across it in other sites, so I thought I would pass it along.

thanks again,

/m
#6

[eluser]Pascal Kriete[/eluser]
It's related to the uri_protocol. With QUERY_STRING, CI just grabs the $_SERVER['QUERY_STRING'] (defined as anything past the ?) and uses that to figure out the controller etc. So without it, you're getting a blank string. Have a look at libraries/URI.php line 105 if you're curious.

With the index page set to index.php? in the config it shouldn't really have been a problem - odd.

Good to hear that it works now.
#7

[eluser]cityzen[/eluser]
thanks much for the reply. I guess my only other question is do i need to keep that ? in there? If so, i'll stop messing around with it and just leave it be. It looks a little weird but, hey, if it works don't break it, right?

thanks again.

/m
#8

[eluser]zvineyard[/eluser]
Many people seem to have problems using .htaccess with GoDaddy, but there is a really simple solution. Check out: http://zacvineyard.com/blog/2008/10/24/w...ermalinks/




Theme © iAndrew 2016 - Forum software by © MyBB