Welcome Guest, Not a member yet? Register   Sign In
Rewrite help.
#4

[eluser]tomcode[/eluser]
Two comments:

1. Maybe You have Your reasons to use two controllers, but for what You are doing You need only one controller :
Code:
class Acasa extends Controller{

    function Acasa()
    {
        parent::Controller();
        
        // You shouldn't use scaffolding on a production site
        $this->load->scaffolding('domenii');
    }    

    function index()
    {
        // You should have a better title (for Google)
        $data['title'] = "http://www.AngajariPitesti.ro/";
        $data['heading'] = "Lista cu domenii";
        $data['query'] = $this->db->get('domenii');
        $this->load->helper('url');
        $this->load->view('acasa_view', $data);
    }

    function categorii($categorie)
    {
       $data['query'] = $this->db->get('domenii');
       $this->load->view('domeniu_view', $data);
    }
}

Which changes Your URL's to :
Code:
anchor('acasa/categorii/xx');
2. You can use a config setting if You want to have .html suffixes in Your URL's :
Code:
$config['url_suffix'] = ".html";
which simplifies Your .htaccess :
Code:
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


Messages In This Thread
Rewrite help. - by El Forum - 08-12-2009, 04:53 PM
Rewrite help. - by El Forum - 08-12-2009, 05:35 PM
Rewrite help. - by El Forum - 08-12-2009, 07:05 PM
Rewrite help. - by El Forum - 08-12-2009, 10:26 PM
Rewrite help. - by El Forum - 08-13-2009, 02:45 AM
Rewrite help. - by El Forum - 08-13-2009, 03:02 AM
Rewrite help. - by El Forum - 08-13-2009, 03:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB