天天看点

rap 接口管理 java_PHPRAP 1.0.0 发布,打造 PHP 版 API 接口管理系统

开启UrlRewrite隐藏入口文件index.php

[Apache]

httpd.conf配置文件中加载mod_rewrite.so模块

将AllowOverride None 改为 AllowOverride All

把下面的内容保存为.htaccess文件放到应用入口文件的同级目录下,默认放在public目录下  RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php?r=/$1 [QSA,PT,L] 

[Nginx]

如果是部署在根目录下,在Nginx.conf中配置转发规则 location / {

if (!-e $request_filename) {

rewrite  ^(.*)$  /index.php?r=$1  last;

break;

}

}

如果是部署在二级目录下,在Nginx.conf中配置转发规则 location /SUB_DIR/ {

if (!-e $request_filename){

rewrite  ^/SUB_DIR/(.*)$  /sub_dir/index.php?r=$1  last;

}

}

SUB_DIR换成自己的目录