Removing the index.php file

By default, the index.php file will be included in your URLs:

example.com/index.php/news/article/my_article

You can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the "negative" method in which everything is redirected except the specified items:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

In the above example, any HTTP request other than those for index.php, images, and robots.txt is treated as a request for your index.php

'프로그래밍 > PHP' 카테고리의 다른 글

실시간 주가정보 파싱하기  (0) 2009/05/08
.htaccess 수정하여 index.php 파일 제거  (0) 2009/05/04
DB 내용 배열에 저장하기  (0) 2009/04/26
mysql 보안  (0) 2009/04/22
Posted by 웹눈