Php .htaccess问题:RewriteBase接受一个参数,即每个目录上下文的基本URL
我使用的是Laravel,在访问我的部分应用程序时,如果不在URL中添加Php .htaccess问题:RewriteBase接受一个参数,即每个目录上下文的基本URL,php,.htaccess,ubuntu,laravel-4,apache2,Php,.htaccess,Ubuntu,Laravel 4,Apache2,我使用的是Laravel,在访问我的部分应用程序时,如果不在URL中添加index.php,就会出现问题。经过一些研究,我发现我需要: 激活“重写”模块 将AllowOverride设置为All 我已经做到了。然而,在做了所有这些之后,出现了一些新问题。首先,我无法访问public文件夹,出现以下错误(查看apache2/error.log): 这是.htaccess文件 <IfModule mod_rewrite.c> <IfModule mod_negotiatio
index.php
,就会出现问题。经过一些研究,我发现我需要:
AllowOverride
设置为All
public
文件夹,出现以下错误(查看apache2/error.log
):
这是.htaccess
文件
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine ON
RewriteBase /laravel/ # Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
理想情况下,我希望用户能够在应用程序中导航,而无需添加index.php。尝试删除行中的注释
RewriteBase /laravel/ # Redirect Trailing Slashes...
其他一切看起来都很好
netfreehost@FL尝试删除行中的注释
RewriteBase /laravel/ # Redirect Trailing Slashes...
其他一切看起来都很好
netfreehost@FL尝试删除行中的注释
RewriteBase /laravel/ # Redirect Trailing Slashes...
其他一切看起来都很好
netfreehost@FL尝试删除行中的注释
RewriteBase /laravel/ # Redirect Trailing Slashes...
其他一切看起来都很好
netfreehost@FL谢谢。必须从行中删除注释!谢谢必须从行中删除注释!谢谢必须从行中删除注释!谢谢必须从行中删除注释!