2012-05-27 1 views
-1

내 링크 (index.php를)어떻게이 .htaccess 파일을 구성 할 수 있습니까? 아래와 같이

<a href="http://localhost/example-link.html">Example Link</a> 

아니면 아래 내 링크 :

<a href="http://localhost/other.html">Other</a> 

나는 "예를-link.html"을 얻고 싶은 링크를 클릭 IR cat.php

Cat.php

<?php 
echo $_GET["cat"]; 
?> 
에서 "other.html"

나는 $ _GET [ "고양이"(예 - link.html 또는 other.html)

+1

귀하의 질문은 전혀 명확하지 않다, 그 정보의 일부가 포함됩니다. 요구 사항을 명확하게 설명하십시오. – anubhava

답변

1
RewriteEngine On 
RewriteRule ^(.+)\.html$ cat\.php 
나는 $ _GET을 인쇄 할

[ "고양이"(예 - link.html를 인쇄하려면 또는 other.html)

미리 정의 된 변수 $_SERVER 아마도 REQUEST_URI

+0

당신이 이해하지 못하는 것 같아요. example-link.html은 단지 예일뿐입니다 :) (감각적 인 변수에서) – Birlikisgu

+0

질문을 이해하기 쉽게 만들어 사람들이 지식을 최대한 활용할 수있게하는 이유는 무엇입니까? –

+0

수정 된 답변보기 전체 사양은 http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html – Filype

0
# Redirect old file path to new file path 
Redirect /example-link.html http://localhost/cat.php 
관련 문제