routing |
Hello,
This is a simple CI3 code that I am still new to: Routing --> I already read the documentation and still having a little problem with it. Can anyone help me? routes.php PHP Code: $route['default_controller'] = 'welcome'; Welcome.php PHP Code: public function index() views/table.php PHP Code: <html> I am trying to test the codes by typing this url: http://localhost/ci3/add Code: Object not found! I wonder why?
" If I looks more intelligence please increase my reputation."
If you're not us get mod_rewrite to remove index.php from your URLs, then try /index.php/add.
as like @skunkbad said you need to call it by href you cannot type in url,
let me teach you ya here is router.php Code: $route['default_controller'] = 'welcome'; here is controller Code: <?php view calling from welcome Code: <h1> Here is view from welcome </h1> view calling by function table Code: <h1> Here is view from table function </h1>
Hey, I wonder did I configure the router correctly?
I wonder why I have type this to open the table: http://127.0.0.1/ci3/index.php/welcome/table ? I also try altering my .htaccess in order to remove index.php from the url and have not been successful yet. Can you help? .htaccess Code: <IfModule mod_rewrite.c> Can you help me figure why I cannot remove the index.php? Thanks in advance.
" If I looks more intelligence please increase my reputation."
(02-23-2016, 02:13 AM)davy_yg Wrote: Hey, I wonder did I configure the router correctly? well first issue already solved or not ?
this is how to remove index.php
ht acsess Code: RewriteEngine on then goes to config.php find Code: $config['index_page'] = 'index.php'; change become Code: $config['index_page'] = ''; then you success remove index.php this i give source code, just learn on it in here
Hello,
I have followed your last advice and still have not been successful removing the index.php I still have to type: http://127.0.0.1/ci3/index.php/welcome/table to show the table. I have alter .htaccess : RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L,QSA] config.php $config['index_page'] = '';
" If I looks more intelligence please increase my reputation."
(02-23-2016, 10:50 AM)davy_yg Wrote: Hello, Where is your RewriteBase / ? What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(02-23-2016, 10:50 AM)davy_yg Wrote: Hello, duh, good luck yah
For what it's worth, my standard .htaccess:
Code: RewriteEngine On |
Welcome Guest, Not a member yet? Register Sign In |