Nginx redirect rules to support old URLs #2

Closed
opened 2024-07-28 18:42:23 +02:00 by jtbx · 2 comments
Owner

The wiki instance used query params for the pages, but the export uses the id as file name. So a mapping from do GET param to file name is needed like this:

  • /doku.php?id=self-organized-sessions -> /self-organized-sessions.html
  • doku.php?id=wiki:dokuwiki -> /wiki/dokuwiki.html

But actually all relevant pages are on the root level. Only intern (not exported), playground (removed as irrelevant), wiki syntax (removed as irrelevant) and ticket-exchanged (removed due to personal data) were in their own namespace.

The wiki instance used query params for the pages, but the export uses the id as file name. So a mapping from `do` GET param to file name is needed like this: - /doku.php?id=self-organized-sessions -> /self-organized-sessions.html - doku.php?id=wiki:dokuwiki -> /wiki/dokuwiki.html But actually all relevant pages are on the root level. Only intern (not exported), playground (removed as irrelevant), wiki syntax (removed as irrelevant) and ticket-exchanged (removed due to personal data) were in their own namespace.
Author
Owner

Do something like this:

    location / {
        ssi on;
        root   /usr/share/nginx/html;
        index  start.html;
    }

    # redirect doku.php?id=$pagename to /$pagename.html
    location /doku.php {
        return 301 $scheme://$host:$server_port/$arg_id.html;
    }
Do something like this: ``` location / { ssi on; root /usr/share/nginx/html; index start.html; } # redirect doku.php?id=$pagename to /$pagename.html location /doku.php { return 301 $scheme://$host:$server_port/$arg_id.html; } ```
Owner

Implemented in ecdaa2d5f6.

Implemented in https://git.hamburg.ccc.de/CCCHH/nix-infra/commit/ecdaa2d5f6ac726b26996f3f37b9818f7951b748.
june closed this issue 2024-10-13 22:11:08 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: CCCHH/easterhegg-eh20-website#2
No description provided.