当前位置:网站首页>User defined domain name, turn on anti red, and count the number of visits

User defined domain name, turn on anti red, and count the number of visits

2020-11-07 23:56:05 TANKING

In our project , If we need to spread our activity links better , But the link is too long 1 It's not beautiful ,2 It's too much “ heavy ”, For example, spell many , Taobao Alliance , Their promotion links are short links , And Sina Weibo .

however , It's always someone else's , We call someone else's API Generate , unstable , So you can make one yourself , Sign up for a shorter domain name , This is the original intention of our open source project , We're trying to give you a stable platform , So I developed a personal short URL generation system .

Functions overview

1、 Create a short URL , You can choose a short URL domain name 、 You can choose anti red
2、 Bind domain name , It is convenient to create short websites under different domain names
3、 You can set anti red , Click on the short website on wechat , Guide the user to open the browser again
4、 You can set the short URL switch , If necessary, you can turn off the access to the short URL
5、 You can count the number of hits on short URLs , The number of visits

Installation environment

php5.6-7.0
mysql 5.7 It can be left or right
apache The server

Because I've only done apache Pseudo static of the server , Pseudo static is only suitable for apache Server usage .

Installation steps

Direct access install that will do
For example, your domain name is :
http://www.xxx.com/
Your program is in the root of the server dwz Catalog
Then start the installation Url yes
http://www.xxx.com/dwz/install/

Pseudo static settings

(1) If you are installed in the server root directory , There is no need to set pseudo static
(2) If you install , Directly point the domain name to the specified subdirectory as the root directory , There is no need to configure pseudo static
(3) If you are installed in a subdirectory under the root of the server , But your server can't point the domain name to the specified directory as the root directory , For example, your code directory is
http://www.xxx.com/dwz/
Then you need to set pseudo static rules

Setup method :
(1) In the server root , remember , It's the root directory, not the root directory of the short URL system , It's the root of the entire server , Create a static file named .htaccess
(2) Then copy the following code , Save it

For example, your code is placed in dwz subdirectories , Need to modify the following pseudo static rule code

#  analysis xxx.cn To dwz subdirectories 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^xxx.cn$ 
RewriteCond %{REQUEST_URI} !^/dwz/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /dwz/$1 
RewriteCond %{HTTP_HOST} ^xxx.cn$ 
RewriteRule ^(/)?$ dwz/index.php [L]

The purpose of this operation is to access your domain name xxx.cn When , That is, by default dwz This directory serves as the server directory , Of course , If you're resolving domain names , You can bind to subdirectories directly on the server , It's more appropriate , The pagoda panel can do this .

The back office address is :http://www.xxx.cn/dwz/index/

Screenshot display

image
image
image

Source code

https://github.com/likeyun/Pe...

Author:TANKING
Date:2020-11-07
Web:http://www.likeyun.cn
WeChat:face6009

版权声明
本文为[TANKING]所创,转载请带上原文链接,感谢