需要帮助屏蔽网址

编程入门 行业动态 更新时间:2024-10-28 06:21:36
本文介绍了需要帮助屏蔽网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要帮助屏蔽的URL。我有我不想让别人知道我网站上的一个子域。所以,我所需要的帮助是这样的:

I am need help "masking" a url. I have a subdomain that I do not want people to know about on my website. So what I am needing help with is this:

我的网站是:www.example

My website is: www.example

我有一个子域:sub.example/test.php

I have a subdomain: sub.example/test.php

当有人点击指向sub.example/test.php~~V一个链接,我不希望sub.example/test.php在地址栏显示。我想为www.example显示代替。

When someone clicks on a link that points to sub.example/test.php, I do not want "sub.example/test.php" to show in the url bar. I would like for www.example to show instead.

任何帮助是极大AP preciated!

Any help is greatly appreciated!

推荐答案

当你要链接到 sub.example/test.php ,更改链接别的东西,像 www.example/sub/test.php 什么的。然后在文档根.htaccess文件的 www.example 补充一点:

When you want to link to sub.example/test.php, change the link to something else, like www.example/sub/test.php or something. Then in your .htaccess file in the document root for www.example add this:

RewriteEngine On RewriteRule ^sub/(.*)$ sub.example/$1 [L,P]

这将内部代理的 www.example/sub / 到 sub.example 任何要求。所以,当有人请求 www.example/sub/path/file.html ,他们真正得到 sub.example/path/file.html 但他们的URL地址栏还是有example URL。你只需要确保改变所有的链接sub.example到example/sub~~V /

This will internally proxy any request for www.example/sub/ to sub.example. So when someone requests www.example/sub/path/file.html, they really get sub.example/path/file.html except their URL address bar still has the example URL. You just need to make sure to change all of your links to sub.example to example/sub/

更多推荐

需要帮助屏蔽网址

本文发布于:2023-10-31 19:25:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547050.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:屏蔽   网址

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!