访问未绑定的域名跳到 RP 主页

This commit is contained in:
jysperm
2014-08-05 00:28:39 +08:00
parent 7d0e851482
commit 39025f6b07
3 changed files with 21 additions and 1 deletions

View File

@@ -32,10 +32,15 @@
rm /etc/nginx/sites-enabled/default
cat > /etc/nginx/sites-available/rpadmin
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
rewrite ^/(.*)$ http://DOMAIN/#redirect permanent;
}
server {
listen 80;
server_name DOMAIN;

View File

@@ -6,6 +6,9 @@ $ ->
if $(@).attr('href') == location.pathname
$(@).parent().addClass('active')
if window.location.hash == '#redirect'
$('#site-not-exist').modal 'show'
$('#logout').click (e) ->
e.preventDefault()
$.post '/account/logout/', {}

View File

@@ -66,3 +66,15 @@ block content
| by  
a(href= 'http://jysperm.me') jysperm
| , yudong
#site-not-exist.modal
.modal-dialog
.modal-content
.modal-header
button.close(type='button', data-dismiss='modal', aria-hidden='true') ×
h4.modal-title 您访问的站点不存在
.modal-body
p 因为您要访问的站点不存在,所以我们将页面重定向到了 RP 主机首页。
p 很可能是由于这个站点的所有者删除或修改了这个站点。
.modal-footer
button.btn.btn-danger(type='button', data-dismiss='modal') 关闭