亚马逊AWS EC2 .htaccess无效

时间:2018-03-24 12:39:39

标签: .htaccess amazon-web-services mod-rewrite amazon-ec2

我使用以下代码更新了.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
    ErrorDocument 404 /404.php
</IfModule>

并重新启动了apache,它总是将我重定向到404而不是在我本地工作的页面,因为我在stackoverflow下经历了很多帖子,我的mod写入启用并在/ etc / apache2 /中更新了这个站点可用/默认

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

1 个答案:

答案 0 :(得分:0)

我认为您需要更改此路径中可用的文件/etc/httpd/conf/httpd.conf