How to remove all .php extension from a dir and all of its subdirectories?

后端 未结 3 1083
遇见更好的自我
遇见更好的自我 2021-01-27 11:49

My web is dir structured is as follows :

moving/
      includes/
      con

3条回答
  •  迷失自我
    2021-01-27 12:14

    apache will not parse your php script if they don't have the ".php" extention.

    but, you can use mod_rewrite:

    This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule, to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, of server variables, environment variables, HTTP headers, or time stamps. Even external database lookups in various formats can be used to achieve highly granular URL matching.

    This module operates on the full URLs (including the path-info part) both in per-server context (httpd.conf) and per-directory context (.htaccess) and can generate query-string parts on result. The rewritten result can lead to internal sub-processing, external request redirection or even to an internal proxy throughput.internal proxy throughput.

提交回复
热议问题