天天看點

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換成自己的目錄