首页 > 解决方案 > Htaccess隐藏url参数键

问题描述

目前我在 htaccess 中做了什么

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
#####exclude /admin88 folder####
RewriteCond %{REQUEST_URI} !^/admin88
#################
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /((?!admin88)[^.]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [NC,L,QSA,R=301]

在所有页面中隐藏 .php,但不包括运行良好的 /admin88 目录

接下来我需要从以下网址

www.example.com/page_name/?lang=en
or
www.example.com/?lang=en

根据我现有的 htaccess 从 url 中隐藏 ?lang

www.example.com/page_name/en
or
www.example.com/en

我试图改变我的 htaccess 但它搞砸了很多

标签: php.htaccessmod-rewriteurl-rewriting

解决方案


推荐阅读