mvccore/ext-request-apachedpi
Composer 安装命令:
composer require mvccore/ext-request-apachedpi
包简介
MvcCore - Extension - Request - Apache DPI - request BasePath property correction for applications using Apache .htaccess [DPI] flag.
关键字:
README 文档
README
MvcCore Extension - Request - Apache DPI
MvcCore Request extension to correct request BasePath property - for applications using Apache .htaccess [DPI] flag.
Installation
composer require mvccore/ext-request-apachedpi
Usage
I you are using more PHP applications with more different domains in one webhosting space, you always need to route every request into different index .htaccess file.
.htaccess in webhosting root:
# disable directory listing Options -Indexes # mod_rewrite <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=REDIRECT_PATH:] # If directory with HTTP_HOST name exists in domains directory, # dispatch request into this webhosting directory with requested application: RewriteCond %{HTTP_HOST} ^(.*)$ RewriteCond %{DOCUMENT_ROOT}/domains/%1 -d RewriteRule (.*) domains/%1/$1 [DPI,QSA,E=REDIRECT_PATH:/domains/%1,L] </IfModule>
.htaccess in application root (classic):
# disable directory listing Options -Indexes # mod_rewrite <IfModule mod_rewrite.c> RewriteEngine On # forbid the direct access to app directories (eg. config-files, ...) RewriteRule ^App/.*$ / [F,L] RewriteRule ^vendor/.*$ / [F,L] # basic zend-framework setup see: http://framework.zend.com/manual/en/zend.controller.html RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*)$ $1 [NC,L] RewriteRule ^.*$ index.php [NC,L] </IfModule>
PHP application Bootstrap.php
Put this patching code in very beginning of your application:
\MvcCore::GetInstance()->SetRequestClass(\MvcCore\Ext\Request\ApacheDpi::class);
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-01-27