.htaccess looks like this:
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.ico)$
RewriteRule ^(.*)$ entryPoint.php [QSA]
</IfModule>
this enforces all request running though entryPoint.php. This processes all files, redirects, etc. Images are free to go, there can be direct references to them. But what about CSS, JS files? I cant add exceptions - because it would reveal the directory structure. All I want is: script src="ds.jss" while they can be at "js/" or "module/x/js/". Same with CSS.
I understand I can do it with entryPoint.php: file_get_contents and outputs. It does work, but its too slow. First we tried it with pictures too.
How to enable a "direct access"?
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ entryPoint.php [QSA]
</IfModule>
Try adding these rewrite conditions...
If you don't want to do that within the php file, you need to add a rule:
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^ds\.jss$ module/x/ds.jss [L]
RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.ico)$
RewriteRule ^(.*)$ entryPoint.php [QSA]
</IfModule>
The important part is the L
flag which stands for Last Docs. It will prevent the other rules to run.
If you want to resolve the filename dynamically but you don't want to use PHP to provide the actual file but your apache server, you can still use PHP to resolve the filename by creating a dynamic rewrite map Docs, search for External Rewriting Program.