阿帕奇重写为Laravel /公 [英] Apache rewrite for Laravel /public

查看:209
本文介绍了阿帕奇重写为Laravel /公的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对此感到抱歉,但我的htdocs根本是错的,我不能改变这种状况。所以我要让它在工作/公共文件夹中。

I am sorry about this, but my htdocs root is wrong and I can't change that. So I have to make it work in the /public folder.

我用的是正常的Laravel .htaccess文件有以下改写:

I use the normal Laravel .htaccess file with the following rewrite:

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

如果我打开 http://kemtime2_neu.pr.domain.de/public 我重定向到<$c$c>http://kemtime2_neu.pr.domain.de/public/http://kemtime2_neu.pr.domain.de/public/login

我该如何解决这个问题?

How can I fix this?

我很想让它从 http://kemtime2_neu.pr.domain.de/ 工作,但得到它与 HTTP的工作: //kemtime2_neu.pr.domain.de/public / 就可以了。

I would love to make it work from http://kemtime2_neu.pr.domain.de/ but getting it to work with http://kemtime2_neu.pr.domain.de/public/ would be fine.

推荐答案

我解决了这部分。如果我有一个的.htaccess根,而不是 /公

I solved it partly. If I have a .htaccess in the root instead of /public with

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

我可以打开 http://kemtime2_neu.pr.domain.de/login 但图像和css仍然是错误的。我需要先检查 /公存在的文件。我认为这是一个<一个href=\"http://stackoverflow.com/questions/15499440/apache-rewrite-if-not-exists-in-public-open-as-public-index-php\">new问题。

I can open http://kemtime2_neu.pr.domain.de/login but the images and css is still wrong. I need to check first if the files exist in /public. I think this is a new question.

这篇关于阿帕奇重写为Laravel /公的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆