주소표시에서 /index.php 제거하는 방법

주소표시에서 /index.php 제거하는 방법

QA

주소표시에서 /index.php 제거하는 방법

답변 1

본문

홈페이지 인덱스화면에서 주소표시줄에 도메인만 나오도록 설정하고 싶습니다.

my-domain.com/index.php

에서 뒤에 index.php 제거

 

찾아보니 .htaccess에서 한다고 해서

아래와 같이 했는데 안되네요.. (www를 고정하는건 잘 됩니다.)

 


<ifmodule mod_rewrite.c>
 
RewriteEngine On
RewriteBase /
 
# www 서브도메인을 항상이용
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
 
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
 
</ifmodule>


그누보드 5, 영카드 사용했고

호스팅은 UTF-8 (PHP5.3, MySQL5.x) 입니다.

 

 

 

이 질문에 댓글 쓰기 :

답변 1

기존 index.php를 index2.php로 이름을 바꾸고 index.php를 아래와 같이 해주세요.

<?
$LastModified = gmdate("D d M Y H:i:s", filemtime($HTTP_SERVER_VARS[SCRIPT_FILENAME]));
header("Last-Modified: $LastModified GMT");
header("ETag: \"$LastModified\"");
?>

<html>
<head>
</head>
<frameset rows="0,*" border=0>
 <frame src="blank.php" name="blank">
 <frame src="index2.php" name="main">
</frameset>
</html>  

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 4
© SIRSOFT
현재 페이지 제일 처음으로