Make /@ URL pass to "web" + redirect to /u/username if activity+json
This commit is contained in:
parent
d775e56c35
commit
83e34a6dd4
|
@ -4,7 +4,7 @@ server {
|
|||
server_name _;
|
||||
|
||||
# Web client
|
||||
location ~ ^(/$|/web) {
|
||||
location ~ ^(/$|/@|/web) {
|
||||
proxy_buffering off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
<?php
|
||||
|
||||
echo 'hola';
|
||||
$uri = trim($_SERVER['REQUEST_URI']);
|
||||
|
||||
# Example: /@username
|
||||
if (preg_match('/^\/\@[a-zA-Z0-9\-\_]+/', $uri))
|
||||
{
|
||||
if ($_SERVER['HTTP_ACCEPT'] === 'application/activity+json') {
|
||||
header('Location: /u/'.substr($uri, 2)); die();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue