0
Hello, I am trying to use htaccess to redirect a project, but I have encountered a problem regarding access to my Public folder, where my Assets are located.
Below follows my .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond Public/$1 -F
RewriteRule (.+) Public/$1 [L]
RewriteCond $0 !^(index\.php|Public/)
RewriteRule ^(.*)$ index.php?key=$1 [QSA]
</IfModule>
The problem that happens is this:
when I make the call on my masterpage <script src="Public/css/styles.css">
he plays the value Public/css/styles.css
to the index.php?key=$1
...
I needed you to access the Public/css folder and make the normal css/js call.
So you’re not doing it, because when I’m on for example site.com/users/list my src="public/Assets" try to access site.com/users/public
– Tafarel Chicotti
puts the absolute path in the link /public/Assets
– Adir Kuhn
I don’t remember where I had read about it, but I did say that using Absolute paths was not a good practice
– Tafarel Chicotti
it is not a good practice your application does not work
– Adir Kuhn
this is a very interesting point too
– Tafarel Chicotti