I am making an application. If my request with url: http://localhost/invoice/public_html/index.php/string-inventory Everything works fine.
If I request with url: http://localhost/invoice/public_html/index.php/string-inventory/new-record or http://localhost/invoice/public_html/index.php/string-inventory/
My application doesn't server right .css or Js. I solved this type of issue from index.php ( no css and js files ) to index.php/ ( with css and js files ) while redirecting to whole different page. But that's not the right way to do. And I am getting 404 for .css and .js files for many pages with same context.
If I comment
RewriteCond %{REQUEST_URI} !..css$ [NC] RewriteCond %{REQUEST_URI} !..js$ [NC]
Then there is 404 but the file is not being served
My .htaccess
Turn rewriting on
Options +FollowSymLinks
RewriteEngine On
# Redirect requests to index.php
RewriteCond %{REQUEST_URI} !=/index.php
RewriteCond %{REQUEST_URI} !.*\.png$ [NC]
RewriteCond %{REQUEST_URI} !.*\.jpg$ [NC]
RewriteCond %{REQUEST_URI} !.*\.css$ [NC]
RewriteCond %{REQUEST_URI} !.*\.gif$ [NC]
RewriteCond %{REQUEST_URI} !.*\.js$ [NC]
#RewriteCond $1 !^(../src)
RewriteRule .* index.php?page=$1 [NC,L,QSA]
My expected url for .css should be http://localhost/invoice/src/css/mystyles.css
Where it is http://localhost/invoice/public_html/src/css/mystyles.css
but If there is not action after controller it works fine. and I do get served expected file. Same for Js.
Need anything, just ask