Hiển thị các bài đăng có nhãn CodeIgniter. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn CodeIgniter. Hiển thị tất cả bài đăng

Thứ Sáu, 21 tháng 2, 2014

.htaccess Rewriting CodeIgniter URLs on Apache 2.4 and mod_fastcgi_handler (FCGI)

.htaccess Rewriting CodeIgniter URLs on Apache 2.4 and mod_fastcgi_handler (FCGI)

CodeIgniter had some problems with mod_rewrite on a shared hosting account where the hoster runs
Apache + FCGI
When you tried to use CI’s SEO URLs, you'll get an error 'No input file specified'.

And the solution here:
Create an .htaccess file in the same directory with index.php and paste into it:

RewriteEngine On
# Existing files and directories remain accessible
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L]

# Redirect the rest
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]

Other solution :
Create a customized PHP.INI file under the root directory of your site with the following line.

cgi.fix_pathinfo = 0;


Read More