• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Eliminating the index.php

#11
[eluser]GabrieleMartino[/eluser]
I didn't delete!

#12
[eluser]Rowan Wilson[/eluser]
Both CroNIX's and my .htaccess should work for you in Apache, so I would guess your server is not configured for mod_rewrite correctly.

There are many guides available. Try here:

http://stackoverflow.com/questions/85751...sting-tool

If all that works and you are happy mod_rewrite is working how it should, come back and let us now and we will have a look at your code.

#13
[eluser]GabrieleMartino[/eluser]
I think i'm getting confused.

In the sense that or is a problem of the server

and here my phpinfo(); tell me that the mod_rewrite is loaded.

Or is a problem of regular expression. That i don't know and i have to study on.

But I think I must before understand where is located the problem if in the first hypotesys or the latter.

There is a way to check on the server if the module is working more properly or the phpinfo() is enough reliable?

#14
[eluser]GabrieleMartino[/eluser]
[quote author="Rowan Wilson" date="1357638787"]Try this one:

Code:
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

The filename is how you've already written it: .htaccess and it must live in the root of your CI installation at the same level as application and system.
FYI the dot in the filename makes it a hidden file if you are looking for it in the terminal. [/quote]

Hi again,

I fix the connection with mod_rewrite that is enabled and the site I get it read the htaccess.

Now i tryed some htaccess but no any works. The site open in main page but when I go with a link i get

/controller/method , on the address bar, and it display 404 error not found in the page

If i still digit by hand on the address bar /index.php/controller/method it works. What's happen? How can I use the link you gave me ?

#15
[eluser]Rowan Wilson[/eluser]
ok cool.

How about showing us where you have your .htaccess file in your CI installation.

Also, it might also be worth seeing your controller code.

#16
[eluser]GabrieleMartino[/eluser]
[quote author="Rowan Wilson" date="1357725216"]ok cool.

How about showing us where you have your .htaccess file in your CI installation.

Also, it might also be worth seeing your controller code.[/quote]

I have the folder

Code:
CI   - Application - controller
                  - models
                  - views

     - System
     - index.php
     - .htaccess
The controller works fine because before i removed $config['index_page'] = '' it where working.

#17
[eluser]Rowan Wilson[/eluser]
ok good.

Are you using Apache or something else.

What do you have in your config.php, base_url, uri_protocol etc?

Also post your htaccess file as well.

#18
[eluser]GabrieleMartino[/eluser]
[quote author="Rowan Wilson" date="1357727262"]ok good.

Are you using Apache or something else.

What do you have in your config.php, base_url, uri_protocol etc?

Also post your htaccess file as well.[/quote]

My htaccess file is the one of you mentioned before, I tried also the one of Chronix and the one in the user guide.

My config file is

Code:
$config['base_url'] = 'http://localhost/safememoirs';

$config['index_page'] = '';

$config['uri_protocol'] = 'AUTO';

I'm using Apache 2.2

On my route I have only the following

Code:
$route['default_controller'] = 'pages/home';

#19
[eluser]Prullenbak[/eluser]
If all is set like you say it is, this url:
http://localhost/safememoirs/
would show you the home function in the pages controller,
as would http://localhost/safememoirs/pages/home/ and http://localhost/safememoirs/index.php/pages/home and even http://localhost/safememoirs/index.php

#20
[eluser]GabrieleMartino[/eluser]
[quote author="Prullenbak" date="1357728783"]If all is set like you say it is, this url:
http://localhost/safememoirs/
would show you the home function in the pages controller,
as would http://localhost/safememoirs/pages/home/ and http://localhost/safememoirs/index.php/pages/home and even http://localhost/safememoirs/index.php
[/quote]

Sorry I didn't get it, can you explain again,please?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.