Welcome Guest, Not a member yet? Register   Sign In
index.php apprears in the scaffolding
#1

[eluser]maomaode[/eluser]
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
#2

[eluser]Michael Wales[/eluser]
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.
#3

[eluser]maomaode[/eluser]
Thanks for you reply,

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

Added this into the hosts

Quote:127.0.0.1 ci.com

In httpd.conf
Code:
<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

Code:
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(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
#4

[eluser]bijon[/eluser]
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>
#5

[eluser]maomaode[/eluser]
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.
#6

[eluser]maomaode[/eluser]
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
#7

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




Theme © iAndrew 2016 - Forum software by © MyBB