Thank you one and all for your patience and help. I am completely restating the question because it is getting quite long from all my revisions. I have an PHP MVC framework with 4 entry points:
from the root:
index.php
index-ajax.php
admin/index.php
admin/index-ajax.php
I needed a .htcaccess file that would take any request and rewrite it to the corresponding file based on the url. The long url would be index.php?rt=cms/view/15 and I wanted it to be index/cms/view/15. That part is pretty much done except for one gotcha.
Here is my .htaccess file now:
# htaccess file for framework - GOOD
Options +FollowSymLinks
# Turn on the mod_rewrite engine - GOOD
RewriteEngine On
# Hide indexes - GOOD
Options -Indexes
# If a file is not one of these, continue processing. - GOOD
RewriteRule \.(css|js|jpg|jpeg|png|gif|ico)$ - [L]
# RewriteRules for folder index files
#RewriteRule ^(index)?(.php)?$ index.php [L] - GOOD
#RewriteRule ^admin(/?)(index)?(.php)?$ admin/index.php [L] - GOOD
# RewriteRules for admin folder arguements - going from more specific to less
RewriteRule ^admin/ajax/[A-Za-z0-9-_/]*$ admin/index-ajax.php?rt=$1 [L]
RewriteRule ^admin/[A-Za-z0-9-_/]*$ admin/index.php?rt=$1 [L]
# RewriteRule for root ajax file
RewriteRule ^ajax/[A-Za-z0-9-_/]*$ index-ajax.php?rt=$1 [L]
# RewriteRule for root file - by here, it is not ajax or admin related, so only
# possible option left if the root index file
RewriteRule ^[A-Za-z0-9-_/]*$ index.php?rt=$1 [L]
I have made a simple site with two folders - 'root' and 'root/admin', and inside of each of those a css,images, and javascript folder with some dummy content. There is an index.php and index-ajax.php file inside of 'root' and 'root/admin' that simple outputs whatever the url argument is and uses a css, js, and image file from each of the folders.
The problem I have now is that if I do a url like index/blah or /admin/index/blah, then the page presents right and the argument is right. However, when I do a url like index/blah/view or admin/index/blah/view then the arguement is right (?rt=blah/view) but the page presents wrong because the css/js/images file go to index/blah/[css] instead of index/[css].
Any ideas on how to handle this? I allowed css/js/image files to go through as is via the .htaccess so there would be less work there.