Php 如何删除';公共';当Laravel安装在子目录中时,从Laravel URL(v5.6)开始
我使用WordPress作为我的商业网站,使用Laravel作为项目管理应用程序 这是我的目录结构Php 如何删除';公共';当Laravel安装在子目录中时,从Laravel URL(v5.6)开始,php,laravel,.htaccess,Php,Laravel,.htaccess,我使用WordPress作为我的商业网站,使用Laravel作为项目管理应用程序 这是我的目录结构 public_html -mainsite (my WordPress site is in this directory) -work (Laravel Application is in this directory) 当用户访问我的主域(例如www.example.com)时,我使用以下.htaccess规则将访问者重定向到www.example.com/mainsite
public_html
-mainsite (my WordPress site is in this directory)
-work (Laravel Application is in this directory)
当用户访问我的主域(例如www.example.com)时,我使用以下.htaccess规则将访问者重定向到www.example.com/mainsite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/mainsite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /mainsite/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ mainsite/index.php [L]
</IfModule>
现在我想允许用户使用此URL访问我的项目管理应用程序
(我想从URL中删除“public”)-
你能帮我解决这个问题吗
(当Laravel安装在根目录中时,从URL中删除“public”很容易,我知道怎么做)
这不是一个重复的问题,原因如下-
我的Laravel安装在我根目录的子目录中,我也在使用不同的站点(WordPress站点)作为我的基本URL- 将Laravel移到公共html之外
- 将Laravel的公用文件夹的内容移动到公用\u html/work
- 将以下代码放入\App\Providers\AppServiceProvider寄存器() $this->app->bind('path.public',function()){ 返回基本路径('public_html/work'); });
www.example.com/work/public
www.example.com/work