Skip to content

Commit

Permalink
automatic redirection for the redirects page itself
Browse files Browse the repository at this point in the history
  • Loading branch information
ivi-admin committed Dec 10, 2015
1 parent 9a5d89a commit 68aa3df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Type: ```Boolean``` Default: ```true```

Whether the homepage's URL (i.e. '/home') should have a 301 redirect to the base URL.

##### redirecty-self

Type: ```String``` Default: ```Homepage```

Where the redirects list should redirect to. Set to whatever URI the redirects list page should redirect to, or set to false to not have it redirect at all. Added so you don't have to remember to redirect the list itself.

##### redirecty-subfolder

Type: ```Boolean``` Default: ```false```
Expand Down
5 changes: 5 additions & 0 deletions redirecty.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ function redirecty() {
if(c::get('redirecty-home', true) && page($uri) && page($uri)->isHomePage())
header::redirect(url());

$self = c::get('redirecty-self', url());

if($self && $uri==$redirectsURI)
header::redirect($self);

foreach($redirects as $redirect):

$match = r($caseSensitive, $uri==$redirect->old(), $uri==str::lower($redirect->old()));
Expand Down

0 comments on commit 68aa3df

Please sign in to comment.