Welcome Guest, Not a member yet? Register   Sign In
newbe, please help.
#1

[eluser]blackgoo[/eluser]
i faced a strange problem.
here is a situation:
i have a domain "www.domain.com"
i`ve installed CodeIgniter iside the root dir (public_html)+ .htaccess as from help section.

and made a simple test page as it was shown in the first tutorial video here.
and i cant launch www.domain.com/blog/
it always redirrects me to welcome.php, thow it should show me "Hello world" page.

PS: www.domain.com/index.php/blog/ works fine.
but the problem is that i cant remove index.php... .htaccess from help section doest help.
what should i do?
thank you and sorry for my english.
#2

[eluser]jedd[/eluser]
Hi blackgoo and welcome to the CI forums.

Did you change application/config/routes.php - specifically the line:

Code:
$route['default_controller'] = "welcome";

If that isn't it, could you post your .htaccess contents?
#3

[eluser]blackgoo[/eluser]
nope... i didnt.
but why should i change it?
the aim was to keep the welcome page as a default one + add a simple /blog/ page from the tutorial.
#4

[eluser]jedd[/eluser]
Okay, well, please post your .htaccess then.

You might want to mention what OS and web server you're working on here.
#5

[eluser]blackgoo[/eluser]
.htaccess:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

blog.php:
Code:
<?php

class Blog extends Controller{

    function index(){
        echo "Hello World";
    }
}


?>

.htaccess is in the root dir (public_html)

OS: *nix (smth like centos) + Apache
#6

[eluser]jedd[/eluser]
Until someone who knows more about these problems than I do pops along, try changing your .htaccess line:

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

to this:
Code:
RewriteRule ^(.*)$ ./index.php/$1 [L]
[/code]

Note the dot. Just on the off-chance that your hosting is a bit funny.

EDIT: Oh, just noticed the public_html reference. I had all kinds of weirdness oging on when I moved from the docroot (/var/www) to my ~/public_html directory. I ended up having to mung my .htaccess back to something hardcoded, thus:
Code:
RewriteRule ^(.*)$ /~jedd/phoko/index.php/$1 [L]

I meant to post on here to see if it was a known problem / easily identified confusion at my end - but didn't get around to it. You may want to try experimenting with that in the short term, too, just in case.
#7

[eluser]blackgoo[/eluser]
i`ve just tried 2 different hostings and both variants of .htaccess
didnt work
seems like the deal is really in public_html dir.

if possible, please construct .htaccess file that will be ok for "www.domain.com/public_html/"
thank you.
#8

[eluser]blackgoo[/eluser]
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [R]
works fine... but i see "index.php" inside URL
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
doesnt work at all (
#9

[eluser]blackgoo[/eluser]
SOLVED

Here is the help: anmsaiful.net/blog/php/remove-codeigniter-index-php.html

thank you all.
#10

[eluser]cahva[/eluser]
Try:
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
(take forward slash out from the beginning of index.php)

This is what I use on several different servers(Windwows dev server WAMP, FreeBSD and on different Linux variants) and it works on all of them with apache 1.3 and newer 2.2.x versions.

It doesnt matter what is the document root dir name. public_html is as good as www or wwwroot etc. Oh, and I use public_html always as my document root Smile




Theme © iAndrew 2016 - Forum software by © MyBB