![](/img/trans.png)
[英]I don't have access to '/public/assets' using Codeigniter 4 when removing index.php from url using a .htaccess file
[英].htaccess to have index.php and assets inside a public folder
我想這樣划分我的項目樹:
我應該有兩個.htaccess
文件(一個在根目錄內 ,另一個在/public
)還是一個?
我的項目在URL http:// localhost / my-project /中
我已經將$system_path
和$application_path
指向其父文件夾,如下所示:
$system_path = '../system';
$application_folder = '../application';
但是我可能會缺少一些東西。
您的根目錄上只需要一個.htaccess
文件,輸入以下內容:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ public/index.php/$1 [L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.