Apache 如何在Laravel应用程序中编写htaccess来访问没有index.html的公共文件夹?
我的.htaccess中有以下内容Apache 如何在Laravel应用程序中编写htaccess来访问没有index.html的公共文件夹?,apache,.htaccess,redirect,laravel-4,Apache,.htaccess,Redirect,Laravel 4,我的.htaccess中有以下内容 <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Fr
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我的问题是当我访问应用程序www.myapp.com/folder1/index.html
很好,但是没有index.html
,像这样www.myapp.com/folder1
不起作用。浏览器显示“重定向循环”
我还在apache配置中设置了
DocumentIndex.html
,但仍然不起作用。感谢您在此处设置阴影。您可以通过向.htaccess添加重写规则,将目录从Laravel的重写规则中排除,如下所示:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Excluded Folders...
RewriteRule ^(folder1|folder2|folder3|e.t.c.)($|/) - [L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
选项-多视图
重新启动发动机
#排除的文件夹。。。
重写规则^(folder1 | folder2 | folder3 | e.t.c.)($|/)-[L]
#重定向尾部斜杠。。。
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Excluded Folders...
RewriteRule ^(folder1|folder2|folder3|e.t.c.)($|/) - [L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>