Welcome Guest, Not a member yet? Register   Sign In
Rewrite the path directories of public
#1

[eluser]Unknown[/eluser]
Hey guys,

I´m trying rewrite the path of the directory public files, like css, js, etc... no sucess !

My directory it´s like that

_ application
__ views
___ themes
____ default
_____ public
______ css
______ js

The current path

/application/views/themes/default/public/css/file.css

That what I need

/public/css/file.css

Or

/themes/dafault/public/css/file.css

Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|public|robots\.txt)

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.*)$ index.php?url=$1 [L]
#2

[eluser]CroNiX[/eluser]
Assets like images, js, css, can't be located within /application or /system.
Code:
/system
/application
/themes <-put them here, in the root directory of your site
--/public
----/default
------/css
------/js
------/images
index.php

#3

[eluser]Unknown[/eluser]
[quote author="CroNiX" date="1378932565"]Assets like images, js, css, can't be located within /application or /system.
Code:
/system
/application
/themes <-put them here, in the root directory of your site
--/public
----/default
------/css
------/js
------/images
index.php

[/quote]

CroNix, thanks man. I wonder if it is possible to remove the theme directory via htaccess? Remembering, the directory of the theme is changeable. Something like that

Before
Code:
/public/{theme}/css/somefile.css

After
Code:
/public/css/somefile.css

I did it like that. But dir theme have to change

Code:
RewriteRule ^public/css/(.*)$ public/default/css/$1 [L]





Theme © iAndrew 2016 - Forum software by © MyBB