I need one 301 redirect on Wordpress site not twice
i need https://www.example.com/sports/test/index.php -> https://www.example.com/sports/test
i have a twice 301 redirect https://www.example.com/sports/test/index.php -> https://www.example.com/sports/test/ -> https://www.example.com/sports/test
I have a site on Wordpress with structure http://www.example.com then i bougth ssl-sertificate and my structure now https://www.example.com
Settings:
1) Permalinks -> custom structure https://www.example.com/%category%/%postname%/
2) Category prefix -> . (just dot)
3) .htacess (with Wordpress original rules for urls)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#use many recomendation
#-------like this
#RewriteCond %{HTTP_HOST} ^example\.com [NC]
#RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
#-------end like this
#-------like this
#RewriteEngine on
#RewriteCond %{HTTP_HOST} !^www\. [OR]
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
#RewriteRule ^ https://www.%1%{REQUEST_URI} [NE,L,R=301]
#-------end like this
RewriteRule ^index\.php$ - [L] #remove index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
All it works but with twice 301 redirects or many loop redirects, i need once redirect on WP site. Thank u for helps me )