EllisLab text mark
Advanced Search
     
index.php apprears in the scaffolding
Posted: 31 August 2007 01:07 AM   [ Ignore ]
Joined: 2007-08-30
21 posts

Hi,

I want to remove the index.php from the urls.
Ihave added the .htaccess which copy from the tutorial, and after watched the blog.mov video, i did the same, using the scaffolding to add some info into the database, the first page of scaffolding is OK, it displayed the rows in the database, but if i click the “edit”, or the “create new”, the index.php appears in the URL, Anyone seen the similar thing before? How can I solve the problem

 
Posted: 31 August 2007 01:46 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-30
2144 posts

The .htaccess in the documentation is a baseline to work off of. To actually make it work, you need a solid understanding of your hosts’ capabilities and .htaccess files.

Please tell us what host you are on and paste your .htaccess file here so we can look into the issue further.

 Signature 

Follow me on twitter here.
MichaelWales.com | MichaelWales.info

 
Posted: 31 August 2007 02:11 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-08-30
21 posts

Thanks for you reply,

I’m on windows platform, PHP5, Apache2, CI 1.5.4

Added this into the hosts

127.0.0.1 ci.com

In httpd.conf

<VirtualHost *:80>    
    
DocumentRoot C:/src/php/CodeIgniter_1.5.4
    ServerName ci
.com
    ErrorLog C
:/src/php/CodeIgniter_1.5.4/logs/error.log
    CustomLog C
:/src/php/CodeIgniter_1.5.4/logs/access.log combined
</VirtualHost

The .htaccess files is located in C:/src/php/CodeIgniter_1.5.4/system/application

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


Sorry, I’m not familiar with the rules of .htaccess, I wish all the urls in the application can remove the index.php.

And, another question is that .htaccess is the only solution for this? Can we do it pragmatically in php?

Thanks again

 
Posted: 31 August 2007 02:53 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2007-08-03
52 posts

first put the .htaccess file in the location of ‘The .htaccess files is located in C:/src/php/CodeIgniter_1.5.4/’


then try…

if not ok then put this code on your .htaccess file

<IfModule mod_rewrite.c>

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

</IfModule>

 
Posted: 31 August 2007 03:12 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2007-08-30
21 posts

bijon,
Thanks for you reply,

I had .htaccess on both the C:/src/php/CodeIgniter_1.5.4/ and C:/src/php/CodeIgniter_1.5.4/system/application dir


I tried your solution, still not working.

 
Posted: 31 August 2007 04:07 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2007-08-30
21 posts

Oh, I can answer my own question now,

After copy the .htaccess file, you also MUST empty the index.php in the config.php

But seems this information is missing in the doc

 
Posted: 31 August 2007 04:09 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2007-08-30
21 posts

And if you use the default dir layout, you must put the .htaccess in the C:/src/php/CodeIgniter_1.5.4/