简体   繁体   中英

How to enable mod_rewrite on (apache 2.4) centos 7 for CodeIgniter Deployment?

I am trying to find a solution to my problem regarding how to enable mod_rewrite module on apache 2.4.6. I tested some solutions that I could find but it seems to me that it is not working. By the way I am using this .htaccess configuration:

 <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /sats/  <-- name of my codeigniter directory
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
 </IfModule>   
 <IfModule !mod_rewrite.c> 
    ErrorDocument 404 /index.php 
 </IfModule>

I still can't seem to find a way to enable mod rewrite. I am also not that familiar with centOS 7. One of my solution was this changing AllowOverride None to AllowOverride All inside the /etc/httpd/conf/httpd.conf on . I don't seem to understand why this didn't work. I also check out some of the solutions here on StackOverflow but it didn't work on it. So any suggestions or things that I didn't do is much appreciated. If you found some solutions I'd like to try that too. Thank you!

将“ LoadModule rewrite_module modules / mod_rewrite.so”添加到配置文件,在目录中写入“ AllowOverride All”,然后重新启动apache。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM