thinkphp隐藏index.php 最简单的方法就是修改应用目录的config.php 增加一行 'URL_MODEL' => 2, 重新访问页面,就可以了。...点击相关页面时,URL地址就不会显示index.php了 别人也不容易知道,这个网站是php写的
Linux Apache 环境 (.htaccess) RewriteEngine On # 下面是在根目录,文件夹要修改路径 RewriteBase / RewriteCond %{REQUEST_FILENAME...-d RewriteRule ^(.*)$ /index.php/$1 [L] Linux Apache 环境(Nginx) location / { index index.html index.php...127.0.0.1:9000; } access_log logs/yourdomain.log combined; } apache...并选择你喜好的url形式: 具体操作,根据本人实际操作如下 我的虚拟主机是apache的,在网站根目录找到.htaccess,有的没有可能是设置了隐藏文件,显示隐藏文件就能看到了。...然后编辑.htaccess文件,加入上文中对应的apache配置代码保存。然后去typecho程序后台,设置>永久链接,按照上文中图片的设置,保存即可。
tp5对URL简化,不做简化情况下我们访问的是localhost/index.php/index/index/index ,做简化后省去index.php。...我们需要找到public下面的.htaccess文件 apache: Options +FollowSymlinks -Multiviews RewriteEngine...-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> index.php...-e $request_filename) { rewrite ^(.*)$ /index.php?...s=$1 last; break; } } apache需要开启rewrite,然后在根目录建立.htaccess文件 内容如下 RewriteEngine...-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
一,找到/public/.htaccess文件,如果你的入口文件已经移动到根目录下,那么你的.htaccess文件也要剪切到根目录下,总之要确保.htaccess跟入口的index.php保持同级。...二,根据你的php环境分别设置.htaccess文件: Apache: Options +FollowSymlinks -Multiviews RewriteEngine...-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] phpstudy: Options...-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] Nginx(在Nginx.conf中添加): location / {...-e $request_filename) { rewrite ^(.*)$ /index.php?
前言 用Typecho的都知道域名后面会加一个index.php,很多人都接受不了这种丑陋东西 例如下网址:https://www.azpay.cn/index.php/post/118.html 但我们希望形式是这样...-e $request_filename) { rewrite ^(.*)$ /index.php$1 last;} ↑配置完成后,清除浏览器缓存并刷新页面就可以了↑
把丑陋的index.php消灭掉吧 前言 用Typecho的都知道域名后面会加一个index.php,很多人都接受不了这种丑陋东西 例如下网址:https://blog.hacther.cn/index.php...-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } ↑配置完成后,清除浏览器缓存并刷新页面就可以了↑ 本篇文章采用 署名 4.0
情景:应用目录下有两个模块 admin(后台) 和 home(前台) 需求:1.访问前台(home)时隐藏index.php 即 域名/home/前台控制器/前台控制器里的方法 这样的访问模式 ...访问后台(admin)时要显示admin.php 即 域名/admin.php/admin/后台控制器/后台控制器里的方法 这样的访问模式 实现原理:nginx重写(我这里只拿nginx作为演示,iis和apache...下请自行测试) 方案1: location / { index index.html index.htm index.php; #autoindex on;...-e $request_filename){ rewrite ^(.*)$ /index.php?...s=$1 last; rewrite ^(.*)$ /index.php?s=$1 last; }
情况 默认设置下文章URL格式为https://www.9kr.cc/index.php/archives/3/,带着个index.php,不好看。...-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } 在Typecho后台开启重写功能 路径:设置 > 永久链接
当开启Apache服务的时候,他人可能通过F12找到你的Apache版本号,从而利用一些已知的漏洞或者零day漏洞来进行攻击。...所以为了减少一点——仅仅是一点的风险,我们可以隐藏Apache的配置 ?...编辑Apache的配置文件 vim /etc/httpd/conf/httpd.conf 添加这一行: ServerTokens prod ?...此时刷新一下网页,发现Apache的版本信息已经被隐藏了 ?...当然,也可以通过修改源码,把Apache换个nginx的马甲,这样查看你版本信息的时候会误以为你用的是nginx,给攻击者额外增加一点难度。 至于如何改马甲,网上搜了几个教程,都没有成功。
(js|jpg|ico|gif|jpeg|bmp|png|css|swf|flv|html|php)$ index.php [L] 最近朋友买了一个XX空间(我没有要黑你的意思,你们老大是我最崇拜的一个人物
已经可以访问,接下来去掉index.php 继续在nginx.conf文件中修改,在其文件中增加: ? location / { if (!....*)$ /index.php?s=$1 last; break; } } 随后重启服务器:service nginx restart 解决~
try_files指令 ,核心功能是替代rewrite,并且比rewrite更强大的是可以按顺序查找文件是否存在,如果文件都找不到才会执行最后的重定向 解决的问题是,如果一个网站的部署是如下结构: css/ js/ index.php...login.php setting.php 2.当有接口的地址是 index.php/article/2 ,这样的path_info模式时,需要隐藏掉index.php,变成/article/2 直接使用...rewrite会影响到当前目录的其他文件因为如果访问/login.php ,会被重定向成index.php/login.php,访问目录的时候/css/,会被重定向成index.php/css/ 3....此时使用try_files就能解决,它会先检查前两个是否存在,如果存在就直接访问文件和目录,如果不存在才会执行后面的重定向 try_files $uri $uri/ /index.php?...上 location /wordpress { try_files $uri $uri/ /wordpress/index.php?
server_name www.jftp6.com; root "D:/code/jflm/public"; location / { index index.php...-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; } }...location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php
一、首先配置路由:http://github.crmeb.net/u/defu 二、项目请求结果: 三、添加index.php后的: 四、找到public文件夹下的.htaccess,原代码:...五、修改方式: 将RewriteRule ^(.*)index.php/index.php/1 [QSA,PT,L]改为: RewriteRule ^(.*)index.php?...s=index.php?s=1 [QSA,PT,L] 六、去掉index.php请求的结果:
一、引言 使用过typecho博客都知道,博客链接中会默认出现index.php/, 为了简洁好看,让我们动手隐藏它吧 二、操作 后台设置 image.png 宝塔设置 如果不进行这一步操作...-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } image.png 重新刷新页面就完成了
,黑客总是喜欢通过使用我们的网站支持(解析)服务器漏洞来进行恶意攻击并获取我们的网站信息,而第一步,则是获取我们网站服务器的版本,近而缩小漏洞搜索范围,而作为一个web运维工程师,第一步则是将这些东西隐藏掉...,从而提供网站的安全系数,下面我门来说说如何在linux服务器下如何隐藏apache(httpd)服务器的版本号。...一、访问服务器查看我们的apache版本号 [root@localhost ~]# curl -I localhostHTTP/1.1 200 OKDate: Thu, 26 Apr...”的版本号; 二、通过编辑apache配置文件来实现隐藏服务版本信息 [root@localhost ~]# find / -name "httpd.conf/usr/local/apache2... # 这里不再显示版本号了Content-Type: text/html; charset=iso-8859-1 四、大功告成 重启Apache
编辑Apache的配置文件 vim /etc/httpd/conf/httpd.conf 添加ServerTokens prod这一行 重启Apache服务 systemctl restart httpd
4,339 A+ 所属分类:WEB应用 nginx 修改nginx.conf http标签 Shell server_tokens off; 1 server_tokens off; apache...: 在apache配置文件httpd.conf中,加入以下代码 Shell ServerTokens Prod ServerSignature Off 12 ServerTokens ProdServerSignature.../catalina/util vim ServerInfo.properties 修改: server.info=Apache Tomcat/7.0.52 (Ubuntu) server.number=...7.0.52.0 server.built=Jun 30 2016 01:59:37 压缩回jar包 cd /usr/local/tomcat/lib jar uvf catalina.jar org/apache...util/ServerInfo.properties 重启tomcat 123456789101112 cd /usr/local/tomcat/libunzip catalina.jarcd org/apache
解决方案phpstudy中: 把 location / { try_files $uri $uri/ /index.php?$query_string; }