Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
howto-cards
Commits
342c34c3
Verified
Commit
342c34c3
authored
Nov 08, 2019
by
Laurent Heirendt
✈
Browse files
redirection to 404
parent
a3894434
Changes
1
Hide whitespace changes
Inline
Side-by-side
.ci/.autoRedirect
View file @
342c34c3
...
...
@@ -14,7 +14,12 @@
}
});
}
UrlExists
(
'
https://r3-core.pages.uni.lu/howto-cards-internal/index.html
'
,
function
(
status
){
// define URLs
var
internalURL
=
'
https://r3-core.pages.uni.lu/howto-cards-internal
'
;
var
externalURL
=
'
https://r3.pages.uni.lu/howto-cards
'
;
UrlExists
(
internalURL
+
'
/index.html
'
,
function
(
status
){
var
s
=
window
.
location
.
href
;
var
pathArray
=
s
.
split
(
'
?
'
);
...
...
@@ -28,22 +33,38 @@
if
(
status
===
200
){
// internal pages
if
(
sub
.
length
>
0
)
{
UrlExists
(
'
https://r3-core.pages.uni.lu/howto-cards-internal/stable/internal/
'
+
sub
,
function
(
status
){
// redirect if card is actually internal and exists
if
(
status
==
200
)
{
window
.
location
.
href
=
'
https://r3-core.pages.uni.lu/howto-cards-internal/stable/internal/
'
+
sub
;
UrlExists
(
internalURL
+
'
/stable/internal/
'
+
sub
,
function
(
status
){
if
(
status
==
200
)
{
// if sub-card is internal in the internal directory and exists
window
.
location
.
href
=
internalURL
+
'
/stable/internal/
'
+
sub
;
}
else
{
window
.
location
.
href
=
'
https://r3-core.pages.uni.lu/howto-cards-internal/stable/external/
'
+
sub
;
UrlExists
(
internalURL
+
'
/stable/external/
'
+
sub
,
function
(
status
){
if
(
status
==
200
)
{
// if sub-card is internal in the external directory and exists
window
.
location
.
href
=
internalURL
+
'
/stable/external/
'
+
sub
;
}
else
{
window
.
location
.
href
=
internalURL
+
'
/404.html
'
;
}
});
}
});
}
else
{
window
.
location
.
href
=
'
https://r3-core.pages.uni.lu/howto-cards-internal/stable/
'
+
sub
;
UrlExists
(
internalURL
+
'
/stable
'
,
function
(
status
){
if
(
status
==
200
)
{
// if card is internal and exists
window
.
location
.
href
=
internalURL
+
'
/stable
'
;
}
else
{
window
.
location
.
href
=
internalURL
+
'
/404.html
'
;
}
});
}
// external pages
}
else
{
// external pages
if
(
sub
.
length
>
0
)
{
sub
=
'
external/
'
+
sub
;
}
window
.
location
.
href
=
'
https://r3.pages.uni.lu/howto-cards/stable/
'
+
sub
;
UrlExists
(
externalURL
+
'
/stable/
'
+
sub
,
function
(
status
){
if
(
status
==
200
)
{
// if sub-car is internal and exists
window
.
location
.
href
=
externalURL
+
'
/stable/
'
+
sub
;
}
else
{
window
.
location
.
href
=
externalURL
+
'
/404.html
'
;
}
});
}
});
</script>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment