Welcome Guest, Not a member yet? Register   Sign In
Running CI without mod_rewrite?
#1

[eluser]simonspoken[/eluser]
I'm trying to get CI running on a server without mod_rewrite installed (and it's not possible to get it installed).

Is this possible? I've created a controller called "test", and have visited:

http://mysite/index.php/test

But that tells me "The URI you submitted has disallowed characters."

Any ideas how I can do this?
#2

[eluser]xwero[/eluser]
do you have a method index in the test class?
#3

[eluser]simonspoken[/eluser]
Here is my test.php controller:
Code:
<?php

class Test extends Controller {

    function Test()
    {
        parent::Controller();    
    }
    
    function index()
    {
        echo "Testing!";
    }
}
?>

EDIT: This is a completely fresh install of CI by the way. I've tried 1.6.1 and 1.5.4 so far.
#4

[eluser]xwero[/eluser]
And do you see the welcome message or did you remove that? I suggest you start from an unmodified CI and check after each major change you make if it still works.
#5

[eluser]simonspoken[/eluser]
The welcome message works if i point it directly at index.php (or just /)/ But if I do this:

http://mysite/index.php/welcome

It doesn't work.
#6

[eluser]xwero[/eluser]
try to change uri_prototcol in the config file
#7

[eluser]simonspoken[/eluser]
http://mysite/index.php/test

PATH_INFO - The URI you submitted has disallowed characters.
QUERY_STRING - Loads default route (Welcome
REQUEST_URI - Loads default route
ORIG_PATH_INFO - The URI you submitted has disallowed characters.

Seems as though none of them work Sad
#8

[eluser]xwero[/eluser]
what is the output if you add
Code:
print_r($_SERVER);
#9

[eluser]simonspoken[/eluser]
Added <pre></pre> to make it easier to read:

Code:
Array
(
    [DOCUMENT_ROOT] => /Library/WebServer/Documents
    [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_ACCEPT_LANGUAGE] => en-us
    [HTTP_CACHE_CONTROL] => max-age=0
    [HTTP_CONNECTION] => keep-alive
    [HTTP_HOST] => 192.168.1.33
    [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.15.1 (KHTML, like Gecko) Version/3.0.4 Safari/523.15
    [PATH] => /usr/bin:/bin:/usr/sbin:/sbin
    [REDIRECT_STATUS] => 200
    [REDIRECT_URL] => /index.php
    [REMOTE_ADDR] => 192.168.1.58
    [REMOTE_PORT] => 61212
    [SCRIPT_FILENAME] => /Library/WebServer/Documents/index.php
    [SERVER_ADDR] => 192.168.1.33
    [SERVER_ADMIN] => [email protected]
    [SERVER_NAME] => 127.0.0.1
    [SERVER_PORT] => 80
    [SERVER_SIGNATURE] =>
Apache/1.3.37 Server at 127.0.0.1 Port 80


    [SERVER_SOFTWARE] => Apache/1.3.37 (Darwin)
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] =>
    [REQUEST_URI] => /index.php
    [SCRIPT_NAME] => /index.php
    [ORIG_SCRIPT_FILENAME] => /opt/iphone/bin/php-cgi
    [ORIG_PATH_INFO] => /index.php
    [ORIG_PATH_TRANSLATED] => /Library/WebServer/Documents/index.php
    [ORIG_SCRIPT_NAME] => /php/php-cgi
    [PHP_SELF] => /index.php
    [REQUEST_TIME] => 1204199467
    [argv] => Array
        (
        )

    [argc] => 0
)

EDIT: I had to delete part of the HTTP_ACCEPT line for it to display on the forum, but that shouldn't make a difference

EDIT 2: And just to clarify, I'm running PHP 5.2.3
#10

[eluser]xwero[/eluser]
For some reason you are getting no variables through. If you put and normal php script where the index.php is and then you try index.php?test=1 and index.php/test. Look if it appears in the $_SERVER array.




Theme © iAndrew 2016 - Forum software by © MyBB