0

I have url: https://example.com/index.php?categoryID=127/index.php Write htacces:

RewriteRule ^index\.php(.*)$ /$1 [R=301,L]
RewriteRule ^(.*)/index\.php(.*)$ /$1$2 [R=301,L]

And I got https://example.com/?categoryID=127/index.php

How can I remove the index.php after the variable? Must use htaccess or need to change the root index.php url by dint of php? How can do that?

Abdul Rafay
  • 312
  • 6
  • 17
Vladishka
  • 1
  • 1
  • 1
    Hello. I don't know what you're trying, but your URL structure looks completly wrong. Why do you have a `index.php?category=XX/INDEX.PHP`??? The second index.php souldn't be there, that doesn't make any sense. You already specified the file you're look at with the first index.php?cat... so you can't look at two files at the same time. Also, index.php isn't a directory, so there can't be a index.php inside of index.php – Twinfriends Mar 02 '17 at 07:49
  • Hello. I agree that it should not be. But there is and I'm trying to get rid of duplicate url (( https://example.com/?categoryID=127/index.php and https://example.com/?categoryID=127 open the same page – Vladishka Mar 02 '17 at 08:37

0 Answers0