RewriteRule htaccess to always remove trailing slash even directory

前端 未结 2 1796
臣服心动
臣服心动 2021-01-16 02:58

The target is to combine several rules:

  • never have a trailing slash in the URI
  • internally rewrite to the index.php (domain.tld/somedir/index.php) when
2条回答
  •  不思量自难忘°
    2021-01-16 03:35

    There is a separate setting in apache called DirectorySlash that can be enabled/disabled. You can read more at httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryslash but be sure to read the part about why this is done right below where it says "some good reasons". Also note the security issue.

提交回复
热议问题