开发者

Masking the URL for one specific page

开发者 https://www.devze.com 2023-01-19 10:17 出处:网络
I haven\'t implemented this feature before myself, so sorry if I\'m a bit vague on details. I know that there are 2 ways to redirect a website site1.com to a second website site2.com. If I recall co

I haven't implemented this feature before myself, so sorry if I'm a bit vague on details.

I know that there are 2 ways to redirect a website site1.com to a second website site2.com. If I recall correctly, in one way, the URL changes to site2.com so the user knows he's being redirected. The second way is to still show the user the original website that he accessed (site1.com) even though he's now really on site2.com. I don't remember the exact term for each type of redirection, but you probably get what I'm talking about.

Well, what I'm interested in is the second way (redirect the user to another website while still showing the original website), BUT for a single page not the whole URL.

What I mean:

site1.com/my_url_of_interest.php 
//gets redirected to othersite.com/my_url_of_interest.php 
//but user still sees site1.com/my_url_of_interest.php 

site1.com/other_url.php
//开发者_运维百科no re-direction happens

Is this possible?


i think you'll be after SymLinks but I'm afraid I don't quite understand the implementation either

http://php.net/manual/en/function.symlink.php

<?php
$target = 'uploads.php';
$link = 'uploads';
symlink($target, $link);

echo readlink($link);
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消