Remove/Redirect index.php from url to prevent duplicate urls

后端 未结 5 1872
盖世英雄少女心
盖世英雄少女心 2021-01-03 09:56

Please read the question carefully before marking as duplicate.

We all know, that using in .htaccess:

RewriteCond %{REQUEST_FIL         


        
5条回答
  •  离开以前
    2021-01-03 10:55

    For Nginx, here is the rules :

    location / {
        rewrite ^/(.*?)index\.php[^/] /$1? redirect;
        rewrite ^/(.*?)index\.php(?:/(.*))?$ /$1$2? redirect;
    }
    

提交回复
热议问题