CodeIgniter Forums
assets folder not found after remove public from url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: assets folder not found after remove public from url (/showthread.php?tid=77828)



assets folder not found after remove public from url - alakian - 10-23-2020

I add/create new .htaccess and add to my root folder for remove public from url:

Code:
DirectoryIndex /public/index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./public/index.php/$1 [L,QSA]

this solution work for me and remove public from url but when I add assets(css/js) in my header, codeigniter not found my assets folder ie:

Code:
<link rel="stylesheet" href="<?php echo base_url('assets/vendor/bootstrap/css/bootstrap.css'); ?>">

output is:

Code:
http://ci.local/assets/vendor/bootstrap/css/bootstrap.css">

This address not work(not found), how do can I fix this problem?