Skip to content

Commit b191e45

Browse files
committed
update:
1、调整目录结构 2、增加阅后即焚的失效功能 3、更新国内IP
1 parent e010817 commit b191e45

19 files changed

+7710
-7671
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea
2-
.project
2+
.project
3+
.DS_Store
4+
log/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Crogram
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

100644100755
Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
## 🔗PHP单文件短链接
1+
# php-app-shorturl
22

3-
本程序只有一个文件,极其方便部署。
3+
## 🔗 PHP 轻量级短链接系统
44

5-
#### 体验预览
5+
本程序是一款简单的短链接生成系统,极其方便部署。
66

7-
<https://x007.in/>
7+
#### 体验预览
88

9+
[url.uiisc.ml](http://url.uiisc.ml)
910

10-
[![preview](https://s1.ax1x.com/2020/11/05/BWYWE4.png)](https://imgchr.com/i/BWYWE4)
11+
![preview](WX20221126-114544.jpg)
1112

1213
### 支持功能
1314

@@ -39,14 +40,25 @@ php -S 127.0.0.1:12138
3940

4041
http://127.0.0.1:12138
4142

42-
##### nginx 配置
43+
##### Nginx 配置
4344

4445
```nginx
4546
location / {
4647
try_files $uri $uri/ /index.php?$query_string;
4748
}
4849
```
4950

51+
##### Apache 配置
52+
53+
```apl
54+
RewriteEngine on
55+
RewriteBase /
56+
RewriteCond %{REQUEST_FILENAME} !-f
57+
RewriteCond %{REQUEST_FILENAME} !-d
58+
RewriteRule ^(.*)$ /index.php/?$1 [L]
59+
```
60+
61+
5062
##### 二级目录配置
5163

5264
比如,`/shorturl/``/` 结尾,实际访问 `http://ip/shorturl/`
@@ -55,24 +67,31 @@ location / {
5567
define('SUB_PATH', '/shorturl/');
5668
```
5769

58-
同样,这里 nginx 要做配置
70+
同样,这里 Nginx 要做配置
5971

6072
```nginx
6173
location /shorturl {
6274
try_files $uri $uri/ /shorturl/index.php?$query_string;
6375
}
6476
```
6577

78+
这里 Apache 要做配置
79+
80+
```apl
81+
RewriteRule ^(.*)$ /shorturl/index.php/?$1 [L]
82+
```
83+
6684
#### API
6785

6886
##### 生成短链接
6987

7088
```bash
71-
curl -s http://127.0.0.1:12138/api/link?url=https://map.baidu.com/poi/%E4%B9%9D%E9%BE%99%E5%85%AC%E5%9B%AD/@12713897.395906774,2531599.1717763273,15.45z
89+
curl -s http://127.0.0.1:12138/api/link?url=https://uinote.com/article-430.html
7290
```
7391

7492
Response
7593

7694
```json
7795
{"msg":"ok","code":200,"data":"http://127.0.0.1:12138/s/aFdlm"}
7896
```
97+

WX20221126-114544.jpg

238 KB
Loading

0 commit comments

Comments
 (0)