亚马逊AWS EC2 .htaccess无效

时间:2023-01-26 12:14:21

I updated .htaccess with the following code

我使用以下代码更新了.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>

and restarted the apache, it always redirects me to 404 instead of pages where as it is working in my local, as i gone through many posts under *, my mod write is enabled and updated this too in /etc/apache2/sites-available/default


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

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 个解决方案

#1


0  

I think you need change below files available in this path /etc/httpd/conf/httpd.conf

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

#1


0  

I think you need change below files available in this path /etc/httpd/conf/httpd.conf

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