隐藏 PHP 页面的 URL [英] Hide URL of PHP page

查看:34
本文介绍了隐藏 PHP 页面的 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏我的 PHP 页面的 URL;也就是说,我不想在href标签中直接写/register.php,我想写/register/并让它打开register.php 页面直接.我想对所有网页都这样做.

I want to hide the URL of my PHP page; that is, I don't want to write /register.php directly in the href tag, I want to write /register/ and have it open the register.php page directly. I want to do that for all the webpages.

推荐答案

在 .htaccess 中试试这个:

In .htaccess try this :

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ $1.php [L,QSA]

这篇关于隐藏 PHP 页面的 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆