URL이

2013-06-07 5 views

답변

2

htaccess를 사용하여이를 수행 할 수 있습니다. 그것은 선 아래로 추가 htaccess로 파일에서

http://example.com/test.php 

http://example.com/folder/40/name/test.php 
http://example.com/folder/40/test.php 

처럼

RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_FILENAME} !(img|anyother folders that you want to ignore|anyother folders that you want to ignore|...) 
RewriteRule ^(.*)/(.*)/(.*)/test.php$ test.php [L] 

RewriteCond %{REQUEST_FILENAME} !(img|anyother folders that you want to ignore|anyother folders that you want to ignore|...) 
RewriteRule ^(.*)/(.*)/test.php$ test.php [L] 

자세한 내용을 모든 URL로 리디렉션됩니다 Htaccess Rewrites

0

쉽게 PHP에 의해 그것을 할 수 있지만 HTML 태그를 열기 전에 두 페이지에서이 코드를 포함해야합니다.

<?php 
$useragent=$_SERVER['HTTP_USER_AGENT']; 
header('Location: http://example.com/test.php'); ?> 

희망이 도움이 될 것입니다!