rejetto forum

How can I set up a simple redirect?

D · 2 · 3752

0 Members and 1 Guest are viewing this topic.

Offline D

  • Occasional poster
  • *
    • Posts: 28
    • View Profile

Offline NaitLee

  • Tireless poster
  • ****
    • Posts: 203
  • Computer-brain boy
    • View Profile
In HFS main window, press Alt+F6 to open "event script", inside put this:
Code: [Select]
[download]
{.set|path|{.decodeuri|%url%.}.}
{.if|{.=|{.cut||4|{.^path.}.}|/123.}|{:{.redirect|/000{.cut|5||{.^path.}.}.}:}.}

Press Ctrl+S to save it.
With this users can view /123 but when they download something they will get from /000
This is explicit, users will see the redirection in address bar.

To edit this, let's say redirect /photo to /picture:
- change /123 to /photo
- change /000 to /picture
- change 4 to 6, i.e. the length of "/photo"
- change 5 to 7, i.e. length of "/photo" +1

Know more about macro "cut" at here

In case your folder name have non-ascii characters, be sure to save the event script in UTF-8 encode
"Computation is not forbidden magic."
Takeback Template | PHFS