routes not working |
[eluser]learning_php[/eluser]
Hi, I have set the following routes: Code: $route['default_controller'] = "homepage"; but they dont seem to be working on my site www.wesayido.co.uk Thanks
[eluser]Dam1an[/eluser]
You don't need the index.php in the re routed path, just the controller, method and args
[eluser]learning_php[/eluser]
Hi, i changed the routes to this: Code: $route['default_controller'] = "homepage"; and link to it like this: Code: <li><a href='homepage/index'>Homepage</a></li> but when i click the live link it takes me to this Code: http://www.wesayido.co.uk/index.php/gallery/homepage/index but the generated code displays this: Code: <li><a href='homepage/index'>Homepage</a></li>
[eluser]Dam1an[/eluser]
you have the index_page in the config set to index.php? as anchors are made up of your base url, index page, and the target
[eluser]learning_php[/eluser]
hi, i looked in the cofig file and it like this Code: $config['index_page'] = ""; Code: <li><a href='index.php'>Homepage</a></li>
[eluser]Dam1an[/eluser]
Do you have your htaccess to rewrite the index.php into the URL? Here's mine Code: DirectoryIndex index.php
[eluser]learning_php[/eluser]
Hi, This is my .htaccess file Code: <IfModule mod_rewrite.c> and my routes are now: Code: $route['default_controller'] = "homepage"; and i am linking to the pages like: Code: <li><a href=''>Homepage</a></li> and i get a 404 error????
[eluser]Thorpe Obazee[/eluser]
I don't know if I get it but don't you need to have Code: echo anchor('info'); to get to homepage/info? then Code: echo anchor('gifts'); to get to homepage/gifts? The routing is quite weird. It's like you're doing routing the other way around.
[eluser]xwero[/eluser]
if you use links to the right controller and method why do you need to use routes?
[eluser]learning_php[/eluser]
Hi I changed my links to this: Code: <li><?= anchor('','Homepage');?></li> the homepage one refreshes the home page but on the Info i still get a 404? |
Welcome Guest, Not a member yet? Register Sign In |