Hello...
i need some help regarding htaccess and rewrite
i have the following file structure:
root
-- .htacces
-- index.php
-- some other files
-- templates
------ template1
------ template2
----------- .htaccess
----------- index.html
-----------------assets
---------------------css
---------------------img
well in my root .htaccess i have the following:
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/assets
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
in my root index.php i have some code that on (file not found, based on my root .htaccess ) i will load a template in template1 or template2 based on information that i collect from a mysql database...
well..
in my templateX root i have one dinamic generated htaccess file that was created when the user create his account.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* template2/$0 [L]
because template1.html files has includes files to assets/ for instance:
<link href="assets/inc/style.css" rel="stylesheet" type="text/css" />
i need to redirect those not found domain.com/assets/inc/style.css to
domain.com/templates/template1/assets/inc/style.css
if i put this on my main .htaccess ( root )
#RewriteRule ^assets/(.*) /template2/html/$0 [NC,L,NS]
it works and all includes on assets load ok..
but on .htaccess i dont know what is the template folder to redirect...so that the .htacces on template folder can redirect
sorry if it's to confuse... :(
basicaly what i want is this:
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
but if the file not found is based on *assets* i want that the system applies the .htaccess file based on the template folder... and
dont execute the rewriteRule to .*index.php/$0
Any help..
Best regards