douxi0098 2016-09-22 23:03
浏览 51

如何使用apache重写来重写从/ admin / recurring / foobar / 123到/ admin / recurring / public / foobar / 123的所有流量

I just installed laravel into /admin/recurring but then I found out that all the goods are in public/ How do I point all traffic coming into /admin/recurring/foo/bar/123 to actually call the request to /admin/recurring/public/foo/bar/123

Here is what I tried:

<IfModule mod_rewrite.c>
    RewriteEngine On

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #This last condition enables access to the images and css folders, and the robots.txt file
    RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
    RewriteRule ^(.*)$ public/index.php/$1 [L]
</IfModule>

But this does not work. It gives me a Sorry, the page you are looking for could not be found. in Laravel 5.3

  • 写回答

2条回答 默认 最新

  • dssk35460 2016-09-23 03:00
    关注

    Would you try this and check if it works? In directory tag add full path to /admin/recurring .

    <Directory "/admin/recurring">
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ public/index.php/$1 [L]
        </IfModule>
    </Directory>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献