2016-12-07 3 views
1

자동 생성 된 URL이 있습니다. 예 :.htaccess로 URL의 일부 숨기기

https://domain.com/folder/login/confirm.php?data=ujOeNXV3cVxuljf/username

이 URL이 자동으로 무 플랫폼에서 사용자 등록에 의해 생성 내가 마지막 매개 변수가 표시되지 않도록 변경하고자합니다. 이런 식으로 뭔가 :

https://domain.com/folder/login/confirm.php

또는

https://domain.com/folder/login

가 어떻게 내 htaccess로이 작업을 수행 할 수 있습니다? 나는 아파치 WS 2.4와 우분투 서버를 가지고있다.

답변

0

주소 표시 줄에 토큰이 표시되는 것을 원하지 않는다고 말하는가?

confirm.php에서 할 수있는 일은 GET 요청으로 오면 confirm.php에 POST로 다시 보내십시오. 이

을 처리하는 경우에만 다음 처음에 주소 표시 줄에 표시됩니다 그래서이

<?php 

if (isset($_GET["data"]){ 
$url = 'https://domain.com/folder/login/confirm.php'; 
$data = array('data' => $_GET["data"]); 



// use key 'http' even if you send the request to https://... 
$options = array(
    'http' => array(
     'header' => "Content-type: application/x-www-form-urlencoded\r\n", 
     'method' => 'POST', 
     'content' => http_build_query($data) 
    ) 
); 
$context = stream_context_create($options); 

} else { 

// if it's not set then you continue processing 

} 
?> 
같은