• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Eliminating the index segment in a URL (htaccess)

#3
[eluser]tim042829[/eluser]
[quote author="bretticus" date="1280895398"]"test" is your controller file so your URL should be:

Code:
http://localhost/CodeIgniter/test/
[/quote]
Actually, the URL above is generating a 404 error
Quote:htaccess will rewrite that internally as:

Code:
http://localhost/CodeIgniter/index.php/test/

according to your Rewrite code.
Calling the previous URL is successful.
Quote:CodeIgniter will automatically call your index method/function in your test controller unless you specify otherwise.

Please note:

Code:
http://localhost/CodeIgniter/test/

and

Code:
http://localhost/CodeIgniter/test/index

are equivalent.
And that previous URL request is also generating a 404 error.
Quote:Anything that needs to work outside of the controller/method URL convention, can be handles via routes (no need to update htaccess.)

See Routing
I appreciate the response. With the 404 error from the http://localhost/CodeIgniter/test/ URL,
I would then guess that there is something wrong with my code or with the .htaccess
code, or in the apache configuration itself.
Any ideas where to look?


Messages In This Thread
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-03-2010, 11:50 AM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-03-2010, 05:16 PM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-03-2010, 05:47 PM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-03-2010, 07:09 PM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-03-2010, 07:35 PM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-04-2010, 09:28 AM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-04-2010, 10:23 AM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-04-2010, 12:36 PM
Eliminating the index segment in a URL (htaccess) - by El Forum - 08-07-2010, 06:27 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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