balloondev / phurl
dev-master
2015-02-09 04:10 UTC
Requires
- php: >=5.5.0
This package is not auto-updated.
Last update: 2024-10-02 06:40:59 UTC
README
一个轻量级且易于使用的URL引擎,创建HTML平面的视图。它不支持视图中的变量,仅对HTML文档进行渲染。
URL示例
###"balloondev.com/contact" -> "view/contact.html" 当请求该URL时,将渲染名为URL段"contact"的HTML文件 -> "contact.html"。
###"balloondev.com/hola/mundo" -> "view/hola/mundo.html" 您也可以有子目录,必须在每个子目录中包含index文件,以便可以访问,例如 "balloondev.com/hola/"。
超轻量级
该引擎非常轻量,重量仅为3.5 KB,旨在创建具有友好URL的简历或着陆页。
配置
Apache
`.htaccess` 文件包含用于运行的重写规则。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
Nginx
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?url=$1;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
许可证
MIT
自由软件,太棒了!