Mod rewrite to change url is baffling me

i need to change my domain as follows (to run in the background - not a redirect):

from - http://www.example.com/index.php/site/site/keyword
to - http://www.example.com/keyword

I would also need the sub-directories css, js, images to remain where they are… they would be the only directories that would need to still be active – I can just pipe those right?

I’m using codeigniter.

I’m wondering if you shouldn’t post this in the codeigniter forums. I know that I’ve read some mod_rewrite threads there that may be helpful.

http://codeigniter.com/forums/

Jeff,

Your example indicates that you are using a CMS which inappropriately (IMHO) uses Options Multiviews (script to be served is in the path).

That said, most canned programs like that have a switch which will hide the long URI. Look for that first. If you can’t find it, then you need to consider what you’re doing as it may break the CMS.

To do what you’re asking requires that YOU change the URI in the links generated by the CMS. THEN you write mod_rewrite statements which check that the file requested does not exist (CSS, js, jpg, etc, WILL exist) before redirecting {keyword} to index.php/site/site/{keyword}. FINALLY, you will need to modify index.php to look at (and parse) {THE_REQUEST} rather than {REQUEST_URI}.

Is it worth the trouble to use a DIY solution rather than a switch within the canned program?

Regards,

DK