2010-12-16 3 views
0

내가 htaccess로를 사용하여 URL에 파일 끝 (.KML)를 추가하기 위해 노력하고있어하지만.htaccess를 사용하여 파일 끝내기를 추가 하시겠습니까?

URL이 나는 그것이 http://resihop.nu/kml.kml이되고 싶은 http://resihop.nu/kml 입니다 작동하지 않는 것은 내가 뭘하려 :

한다 RewriteRule^kml.kml의 $ KML

다음

내 전체 .htacess :

# Turn on URL rewriting 
RewriteEngine On 

# Installation directory 
RewriteBase/

# Protect hidden files from being viewed 
<Files .*> 
    Order Deny,Allow 
    Deny From All 
</Files> 

# Protect application and system files from being viewed 
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] 

# Allow any files or directories that exist to be displayed directly 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

# Rewrite all other URLs to index.php/URL 
RewriteRule .* index.php/$0 [PT] 

RewriteRule ^kml\.kml$ kml 

답변

0

.kml 파일을 처리하는 방법을 서버에 알려줘야합니다. 당신의 .htaccess이 줄을 추가

AddType application/x-httpd-php .kml 

가 (당신이 .KML 파일이 PHP로 구문 분석 할 가정합니다.)

편집 : 신경 쓰지 마, 그냥 질문을 다시 읽고 나는이 아닌을의 실현 문제. 그냥 무시해!

0

이 자신의 확장자를 사용하는 사용자의 경우에 작동합니다 :

Options +FollowSymlinks 
RewriteEngine On 
RewriteBase/
RewriteRule ^(.+)\.kml$ /$1.php [NC,L] 

그러면 hello.kml과 같은 .kml 확장자가있는 파일에 액세스 할 수 있습니다.

희망이 도움이됩니다.

+0

아니요, 저는 두렵지 않습니다. / – Himmators

관련 문제