Apache Plesk服务器上的Laravel-只能通过呼叫/public访问

Apache Plesk服务器上的Laravel-只能通过呼叫/public访问,apache,.htaccess,laravel,mod-rewrite,plesk,Apache,.htaccess,Laravel,Mod Rewrite,Plesk,当设置新的Laravel安装时,我们必须使用domain.com/public而不是domain.com来运行它 我在谷歌上搜索了这个问题,发现这可能是因为没有启用mod_rewrite。但是,我们正在服务器上运行Plesk,其文档位于: 如果我将public的内容移动到主文件夹中,将其余内容移动到/Laravel文件夹中(只需采用main index.php文件),那么Laravel工作正常 但是,我想保留原始的文件结构。 有什么提示吗?只需使用.htaccess从/to/public重定向即

当设置新的Laravel安装时,我们必须使用domain.com/public而不是domain.com来运行它

我在谷歌上搜索了这个问题,发现这可能是因为没有启用
mod_rewrite
。但是,我们正在服务器上运行Plesk,其文档位于:

如果我将public的内容移动到主文件夹中,将其余内容移动到/Laravel文件夹中(只需采用main index.php文件),那么Laravel工作正常

但是,我想保留原始的文件结构。
有什么提示吗?

只需使用.htaccess从/to/public重定向即可。也许和这个差不多

RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]