• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange URI behavior

#1
[eluser]gentleJuggernaut[/eluser]
I have just set up CI 1.7.

When I go to the base of my site I get the welcome page as expected.

http://localhost/

When I try to go to the controller I get a 404 page not found error.

http://localhost/welcome/

Now the odd thing is that when I put a ? in front of the controller name it works as I would expect just the controller name to work

http://localhost/?welcome/

I am not really clear on how the .htaccess file works, so here is what I am currently using (from the URI page of the CI manual):

RewriteEngine on
RewriteCond $1 !^(index\.php|public|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


I dug around and found some topics that were similar and they suggested putting a ? at the end of the index.php reference in the .htaccess file, so I have also tried this (with no change in results):

RewriteEngine on
RewriteCond $1 !^(index\.php|public|images|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]


I have set $config['base_url'] to the base of my site
I have set $config['index_page'] = ""
I have left $config['uri_protocol'] = "AUTO"
I have left $config['enable_query_strings'] = FALSE

Any ideas?

Thx.

#2
[eluser]bastones[/eluser]
Code:
$config[‘uri_protocol’] = “AUTO”

Just above this variable you see some comments:

Code:
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'        Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'        Uses the REQUEST_URI
| 'ORIG_PATH_INFO'    Uses the ORIG_PATH_INFO
|
*/

Try each one, PATH_INFO, QUERY_STRING, REQUEST_URI and ORIG_PATH_INFO and one should work for you Smile.

#3
[eluser]gentleJuggernaut[/eluser]
Thx for the prompt reply.

I have tried all of the different approaches with these two URI's:

1) http://localhost/welcome/
2) http://localhost/?welcome/

None of them work for URI #1
All of them except 'REQUEST_URI' work for URI #2

'REQUEST_URI' gives me the message 'The URI you submitted has disallowed characters.' in the browser window.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.