如何删除所有的PHP扩展,从一个目录及其所有子目录? [英] How to remove all .php extension from a dir and all of its subdirectories?

查看:326
本文介绍了如何删除所有的PHP扩展,从一个目录及其所有子目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站是目录结构如下:

My web is dir structured is as follows :

移动/
            包括/
            控制器/
            包括/
            等等...

moving/
      includes/
      controllers/
      includes/
      etc...


我有一个关于以下几个问题/移动及其所有子diretories:


I have the following questions about /moving and all of its sub-diretories:

  1. 如何申请任何PHP脚本没有扩展名.php?
  2. 如何申请 ... DIR / index.php的?Q =约刚才 ... DIR /约
  3. 竟被我在哪里把我的.htaccess文件?
  1. How can i request any php script without the .php extension?
  2. How can i request ...dir/index.php?q=about as just ...dir/about?
  3. Where woul i place my .htaccess file?

据我所知,我的第一个问题的也许的是重复的,但为了我的脉络第二和第三个问题我不得不问吧。

I understand that my first question might be a duplicate, but in order to contextualize my second and third question i had to ask it.

使用WampServer 2.0 提前致谢。

Using WampServer 2.0 Thanks in advance.

推荐答案

Apache将无法解析PHP脚本,如果他们不具备.PHP延伸。

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

不过,您可以使用 mod_rewrite的

这个模块使用基于规则的   重写引擎(基于   定期-EX pression解析器)重写   在飞行请求的URL。它支持   无限数量的规则和   无限数量的附加规则   条件对于每个规则,以提供一个   真正灵活和强大的URL   操作机制。该网址   操作可以取决于各种   服务器变量的测试,   环境变量,HTTP头,   或时间戳。即使外部数据库   各种格式的查找可以使用   实现高​​度细化的网址   匹配。

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.

这个模块运行在完整的URL   (包括路径信息的一部分)无论是在   单个服务器中(httpd.conf文件)和   每个目录上下文(的.htaccess)和   可以生成查询字符串部分   结果。重写的结果可能会导致   到内部子处理,外部   请求重定向或甚至   内部代理throughput.internal代理吞吐。

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.

这篇关于如何删除所有的PHP扩展,从一个目录及其所有子目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆