Laravel从url中删除projectname/public/index.php
所有的url在本地工作都很完美,在远程,事情变得一团糟 我必须访问我的路由,比如Laravel从url中删除projectname/public/index.php,php,laravel,.htaccess,server,remote-access,Php,Laravel,.htaccess,Server,Remote Access,所有的url在本地工作都很完美,在远程,事情变得一团糟 我必须访问我的路由,比如example.com/project/public/index.php/someRoute 我使用根目录中的.htaccess从url中删除了index.php: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L]
example.com/project/public/index.php/someRoute
我使用根目录中的.htaccess
从url中删除了index.php:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
接下来我在JS文件中有一些硬编码的URL,基本上我使用的是高图表,点击饼图将显示相关结果。因此,上面的.htaccess
不起作用
我当前的目录结构是/var/www/html/project
,其中服务器根目录是/var/www/html
如何使用
example.com
访问我的项目如果你想让你的应用程序在你的域的顶层可用,你需要调整你的服务器根。一种快速调整服务器的方法,而无需在它下面放置炸弹,请问。你是什么意思?我的意思是我总是误解我的apache,基本上只是把vhost的根设置为/var/www/html/project
,你应该准备好了:)好的,我把它改为/var/www/html/project
,现在我只能删除index.php
。