[英].htaccess to have index.php and assets inside a public folder
I want to have my project tree divided like this: 我想这样划分我的项目树:
Should I have two .htaccess
files (one inside the root and another inside /public
) or just one? 我应该有两个
.htaccess
文件(一个在根目录内 ,另一个在/public
)还是一个?
My project is in the URL http://localhost/my-project/ 我的项目在URL http:// localhost / my-project /中
I have already pointed $system_path
and $application_path
to their parent folder, like this: 我已经将
$system_path
和$application_path
指向其父文件夹,如下所示:
$system_path = '../system';
$application_folder = '../application';
But I might be missing something. 但是我可能会缺少一些东西。
You need only one .htaccess
file on your root directory, with following entry: 您的根目录上只需要一个
.htaccess
文件,输入以下内容:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ public/index.php/$1 [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.