【发布时间】:2018-01-22 23:34:53
【问题描述】:
我想将 laravel 配置为每当用户访问 domain/api 他实际访问公用文件夹时
我已经尝试了以下
1.创建了一个文件 laravel.conf
<VirtualHost *:80>
ServerName ipaddress/api
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/api/public
<Directory /var/www/html/api>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
然后
sudo a2dissite 000-default.conf //disabled defaul loading
sudo a2ensite laravel.conf
sudo a2enmod rewrite
sudo service apache2 restart
但是现在上面的失败了
但是在 virtualHost 配置上,当我在没有 api 的情况下创建 servername to ipaddress 时,每当我访问它读取 api/public 的 IP 地址时,我希望它在用户访问时读取 api/public
ipaddress/api.
我还需要补充什么?
我在关注 This tutorial
【问题讨论】: