Part of the EllisLab Network
   
2 of 2
2
How to start a project with CodeIgniter?
Posted: 31 January 2012 01:11 PM   [ Ignore ]   [ # 11 ]  
Summer Student
Total Posts:  1
Joined  01-31-2012
Mauricio de Abreu Antunes - 31 January 2012 05:28 AM

“CI assumes you already know how to program in PHP, use webservers, css, etc.”

My situtation is:

http://localhost/percutz

In percutz folder i have my .htaccess file with those configs. (not working)
I removed index.php from config.php.
I tried to access http://localhost/percutz/teste (i have a controller called teste) or http://localhost/index and the files were not found.

I know what is Apache, .htaccess, rewrite rules, but how you can see, my configs are not working for a reason what i’m not seeing…

Bye!

I wonder how you modify in your .htaccess file
RewriteRule ^(.*)$ index.php/$1 [L] means all the stuffs are placed in the root folder.
In your case, i think, you should change to RewriteRule ^(.*)$ /percutz/index.php/$1 [L]
Hope that will help your

Profile
 
 
Posted: 31 January 2012 03:10 PM   [ Ignore ]   [ # 12 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5399
Joined  06-19-2009

Maybe he needs to turn on mod_rewrite in the apache server - apache/conf/httpd.conf

 Signature 

Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

Profile
 
 
Posted: 31 January 2012 05:34 PM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  250
Joined  01-30-2012
InsiteFX - 31 January 2012 03:10 PM

Maybe he needs to turn on mod_rewrite in the apache server - apache/conf/httpd.conf

I turned it on wink

 Signature 

Time for the true display of skills.

Profile
 
 
Posted: 31 January 2012 05:59 PM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  250
Joined  01-30-2012

Thanks for all!
I noticed that my .htaccess was not overwriting my httpd.conf.
Sorry guys! :(

But its ok now:

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

It’s my .htacces. Any suggestions?
Ok, i have another issue now: when i go for http://localhost/percutz/index (like index.php), why am i getting Page Not Found?
I need to go http://localhost/percutz for access to my new “home” and not localhost/percutz/index?
Can i redirect http://localhost/percutz/index to http://localhost/ with no php redirect?

Btw, thanks again! I’m learning PHP. I program Oracle and ASP.Net. smile

 Signature 

Time for the true display of skills.

Profile
 
 
Posted: 01 February 2012 03:53 AM   [ Ignore ]   [ # 15 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  163
Joined  04-27-2007

hi Mauricio de Abreu Antunes

try this for a good htaccess http://www.farinspace.com/codeigniter-htaccess-file/

be sure index.php is defined as controller is not only about the filename
example name.php

class Name extends CI_Controller
{
    
function __construct()
    
{
        parent
::__construct();
    
}

    
public function index()
    
{
 
echo 'hi';
    
}

in config/routes.php you can define default_controller so when you visit http://localhost/percutz the default controller/index function is run
read the user_guide http://codeigniter.com/user_guide/general/controllers.html

 

Profile
 
 
   
2 of 2
2