Welcome Guest, Not a member yet? Register   Sign In
problems in routing
#1

[eluser]Unknown[/eluser]
Hello all!!!
I am working on my brand new sitedeveloped in CI.
I have already enabled .htaccess to avoid index.php in my urls.
To let you better understand I will explain my current setup:
I have a class called post which has a function to show post called get_post;
The controllers,models and views are under subfolders called site: example the post class location:
application/controllers/site/post.php
I am working on routing and I have found several difficulties because I need to have the url like /post/name_of_the_post
I have put the following in routes.php

$route['post/(:any)'] = 'site/post/get_post/$i';

In this way the controller works but all the other urls get broken(css,js,images). If I change the "/" with , for example "-", all works fine.
I resolve the url of the css,js images in a relative matter.
I am relatively confused about: I would think to rewrite urls directly in htaccess instead.
I thank everyone for the help

Rudy from Italy




Theme © iAndrew 2016 - Forum software by © MyBB