search
HomeBackend DevelopmentPHP Tutorial怎样实现http路径隐藏,急!

rt,出于安全性考虑,求方法!


回复讨论(解决方案)

如果是传送文件,可以一边fread,一边echo

如果是传送文件,可以一边fread,一边echo

不是这个意思,我是想让别人访问我的网站时看到的地址不是我网站的真实地址,而且通过查看源代码,也看不到我的真实地址。

防君子不防小人,抓包就能看到
而且这样做没意义,网站不让人记住,只能是访问一次就不能再来了?

1.服务器控制,不停的转换映射
2.搞N个镜像,随机跳
3.不用域名,只用ip,然后后面的路径全部用一大串数字,还分层,哼,看谁不用bookmark能记住?!

楼主是不是需要个简单的 url重写

比如www.xxx.com/abc/3.php?def=39  改写为  www.xxx.com/d/39

实际上网站根目录下是没有d这个文件夹的

楼主说的是URL重写吧?  
配置.htaccess或者是nginx.conf,或者是很多开源框架都支持url重写的。

防君子不防小人,抓包就能看到
而且这样做没意义,网站不让人记住,只能是访问一次就不能再来了?

1.服务器控制,不停的转换映射
2.搞N个镜像,随机跳
3.不用域名,只用ip,然后后面的路径全部用一大串数字,还分层,哼,看谁不用bookmark能记住?!

<html><head><link rel="shortcut icon" href="./images/favicon.ico"><title>信息管理系统</title><meta http-equiv=Content-Type content=text/html;charset=utf8></head><frameset rows="64,*"  frameborder="NO" border="0" framespacing="0">	<frame src="top.php" noresize="noresize" frameborder="NO" name="topFrame" scrolling="no" marginwidth="0" marginheight="0" target="main" />	<frameset cols="200,*"  rows="800,*" id="frame">	<frame src="left.php" name="leftFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" target="main" />	<frame src="right.php" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="_self" />  </frameset></frameset><noframes>  <body></body></noframes></html>

我想将这段代码中的right.php这个地址隐藏,换成lw.php(不存在这个文件),让那些通过浏览器查看源代码的人看到的不是right.php而是lw.php,但是通过访问lw.php可以跳转到right.php。而且在跳转到right.php时在地址栏里看到的是http://bbs.csdn.net/topics/390582783?page=1#post-395490800这种形式的地址。

目的就是让其他人无法找到我的right.php源文件。

你说的那3个办法我不懂啊,能不能详细讲一下,或者给个关键字我自己去搜。

楼主是不是需要个简单的 url重写

比如www.xxx.com/abc/3.php?def=39  改写为  www.xxx.com/d/39

实际上网站根目录下是没有d这个文件夹的
php源文件里重写url能做到么

楼主说的是URL重写吧?  
配置.htaccess或者是nginx.conf,或者是很多开源框架都支持url重写的。
php源文件里重写url能做到么

你这需求,#5的方法可以满足,自己搜搜本版url rewrite相关帖子或google

你这需求,#5的方法可以满足,自己搜搜本版url rewrite相关帖子或google
#5是什么


你这需求,#5的方法可以满足,自己搜搜本版url rewrite相关帖子或google
#5是什么
5楼


楼主是不是需要个简单的 url重写

比如www.xxx.com/abc/3.php?def=39  改写为  www.xxx.com/d/39

实际上网站根目录下是没有d这个文件夹的
php源文件里重写url能做到么

重写后 直接就把lw.php当做right.php用就是了   写转跳就写lw.php,会自动跳到right.php

没问题的


楼主说的是URL重写吧?  
配置.htaccess或者是nginx.conf,或者是很多开源框架都支持url重写的。
php源文件里重写url能做到么

能,比如zend framework框架,你只需要在源代码index.php配置Router就可以了。

重写后 直接就把lw.php当做right.php用就是了   写转跳就写lw.php,会自动跳到right.php
没问题的
我先试试
跳转页面后显示的地址可以改成http://bbs.csdn.net/topics/390582783?page=1#post-395490800这种形式的地址吗?


重写后 直接就把lw.php当做right.php用就是了   写转跳就写lw.php,会自动跳到right.php
没问题的
我先试试
跳转页面后显示的地址可以改成http://bbs.csdn.net/topics/390582783?page=1#post-395490800这种形式的地址吗?

思路反过来如何?    如果你想显示这种形式 那就要按照这种形式转跳 然后按照这种形式来写重写规则以指向真正的页面



重写后 直接就把lw.php当做right.php用就是了   写转跳就写lw.php,会自动跳到right.php
没问题的
我先试试
跳转页面后显示的地址可以改成http://bbs.csdn.net/topics/390582783?page=1#post-395490800这种形式的地址吗?

思路反过来如何?    如果你想显示这种形式 那就要按照这种形式转跳 然后按照这种形式来写重写规则以指向真正的页面

<IfModule mod_rewrite.c>	RewriteEngine on   //on为打开,off为关闭	RewriteRule main.php$ index.php</IfModule>


我这么写的.htaccess怎么不行呢?出错Your browser sent a request that this server could not understand.



楼主说的是URL重写吧?  
配置.htaccess或者是nginx.conf,或者是很多开源框架都支持url重写的。
php源文件里重写url能做到么

能,比如zend framework框架,你只需要在源代码index.php配置Router就可以了。

我重写了出错,见楼上。main.php是我的真实地址 index.php是虚拟的,这样不对吗?

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Performance Tuning for High Traffic WebsitesPHP Performance Tuning for High Traffic WebsitesMay 14, 2025 am 12:13 AM

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

Dependency Injection in PHP: Code Examples for BeginnersDependency Injection in PHP: Code Examples for BeginnersMay 14, 2025 am 12:08 AM

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

PHP Performance: is it possible to optimize the application?PHP Performance: is it possible to optimize the application?May 14, 2025 am 12:04 AM

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

PHP Performance Optimization: The Ultimate GuidePHP Performance Optimization: The Ultimate GuideMay 14, 2025 am 12:02 AM

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)