douxuzui4590 2017-06-23 05:16
浏览 61

Apache Laravel配置问题

I am having an issue with getting Laravel to work properly with Apache2. This is my config file, but whenever it go to my domain I see directory list, and I need to enter to portfolio/public to see the app. That's also what the url become (my-website.com/portfolio/public/). Is there any way I can fix this? I've been trying to deploy this app for 3 days and still had no success...

Great Thanks!

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName  my-domain.com
    ServerAlias www.my-domain.com
    DocumentRoot /var/www/html/portfolio/public

<Directory /var/www/html/portfolio/public>
    AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<Directory /var/www/html/portfolio/public>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin>
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>
  • 写回答

1条回答 默认 最新

  • duanpi5733 2017-06-23 05:18
    关注

    This might help you

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /public/index.php/$1 [L]
    

    Source

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度