1
example.com
的DocumentRoot
在/var/www/html
中。如何设置Apache以运行基于子路径的Laravel?
Laravel安装在/var/www/example/public
,我可以用它访问http://example.com/dashboard
但是当我试图访问像其他途径为http://example.com/dashboard/login
,并抛出404 Not Found
错误出现问题。并说The requested URL /var/www/example/public/index.php was not found on this server.
任何人都可以请指导我?
公用目录中的.htaccess文件未被改动。
这里是000-default.conf
:
ServerName example.com
UseCanonicalName Off
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /dashboard /var/www/example/public
<Directory /var/www/example/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
#dynamic subdomain provisioning
<VirtualHost *:80>
DocumentRoot /var/www/example/public
ServerName user.example.com
ServerAlias *.example.com
<Directory /var/www/example/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>