从index.php url中删除变量?categoryID=27/index.php

从index.php url中删除变量?categoryID=27/index.php,php,.htaccess,url,cnc,Php,.htaccess,Url,Cnc,我有网址:https://example.com/index.php?categoryID=127/index.php 写htacces: RewriteRule ^index\.php(.*)$ /$1 [R=301,L] RewriteRule ^(.*)/index\.php(.*)$ /$1$2 [R=301,L] 我得到了https://example.com/?categoryID=127/index.php 如何删除变量后面的index.php?必须使用htaccess,还是需要

我有网址:
https://example.com/index.php?categoryID=127/index.php
写htacces:

RewriteRule ^index\.php(.*)$ /$1 [R=301,L]
RewriteRule ^(.*)/index\.php(.*)$ /$1$2 [R=301,L]
我得到了
https://example.com/?categoryID=127/index.php

如何删除变量后面的index.php?必须使用htaccess,还是需要借助php更改root index.php url?
你怎么能这么做?

你好。我不知道你在尝试什么,但是你的URL结构看起来完全错了。为什么有一个
index.php?category=XX/index.php
???第二个index.php应该不存在,这没有任何意义。您已经使用第一个索引指定了要查看的文件。php?cat。。。所以不能同时查看两个文件。另外,index.php不是目录,因此index.phpHello中不能有index.php。我同意不应该这样。但是确实存在,我正在尝试消除重复的url((并打开相同的页面)