Rewrite help. |
[eluser]adrian.web20[/eluser]
I'm really really tired. I've been working all day on this. First of all, the User Guide helped me a lot but until a point. Right now, my head doesn't help me a lot. I seriously need somebody to tell me "Dude, it's wrong because: " Please help me :| I'm kinda desperate. I want to make a job seeker website. I've made a db with some job domains categories. This is the URL for testing purposes: http://blt.ath.cx/ I've hit a big bad wall here. As you can see on the website. The rewrite works perfectly... a bit messed up but that's not a problem, for now. I've manage to go so far but... know I realize I can't do nothing because I don't know how to get the ID from the category, which is very important. Can somebody please, look over my work and give me some suggestions? I can't continue without your help :| Thank you acasa.php Code: <?php oferta.php Code: <?php 2 views acasa_view.php Code: <html> domeniu_view.php Code: <html> .htaccess Code: RewriteEngine On
[eluser]kaola[/eluser]
RewriteEngine On RewriteBase / RewriteRule ^categorie/(.*)\.html$ /oferta/categorii/$1 [C] RewriteRule ^(.*)$ /index.php/$1 [L]
[eluser]Rick Jolly[/eluser]
This might work: Code: RewriteEngine On To keep your .htaccess simpler, you might want to use CI routes instead for these routing exceptions: http://ellislab.com/codeigniter/user-gui...uting.html
[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{ Which changes Your URL's to : Code: anchor('acasa/categorii/xx'); Code: $config['url_suffix'] = ".html"; Code: RewriteEngine On
[eluser]adrian.web20[/eluser]
But the parameter for the categorii() function is something like this: 1-agricultura-pescuit-si-silvicultura.html How do I use the id (ex: 1) to query the database for detailes ? Thanks a lot!
[eluser]tomcode[/eluser]
Do You need to pass the whole (1-agricultura-pescuit-si-silvicultura.html), passing only the id (1) does it, too. If yes though, You could do : Code: $cat_parts = explode('-', $categorie);
[eluser]adrian.web20[/eluser]
Geez :| You are an angel sent from Heaven ) Thank you have much. |
Welcome Guest, Not a member yet? Register Sign In |