diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-10 22:35:17 +0000 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-10 22:35:17 +0000 |
| commit | ce55f527666e6726c811464ef341cb67742f7137 (patch) | |
| tree | 537e94255655327fa1834db41d9b973d378c8345 /src | |
| parent | f130f495e54a890c0fe3c8f790a8e48a54f41e02 (diff) | |
Add trailing slash to URLs to prevent redirect
The Apache configuration redirects requests with out a trailing slash.
It does a redirect without preserving the http method.
E.g. a POST /store redirects to GET /store/
Diffstat (limited to 'src')
| -rw-r--r-- | src/templates/confirm_deletion.php | 2 | ||||
| -rw-r--r-- | src/templates/create.php | 2 | ||||
| -rw-r--r-- | src/templates/edit.php | 2 | ||||
| -rw-r--r-- | src/templates/index.php | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/templates/confirm_deletion.php b/src/templates/confirm_deletion.php index 2938c4b..29cd590 100644 --- a/src/templates/confirm_deletion.php +++ b/src/templates/confirm_deletion.php @@ -12,7 +12,7 @@ <h1>Bookmarks</h1> <h2>Confirm Deletion</h2> <a href="/">Back</a> - <form action="/delete" method="POST"> + <form action="/delete/" method="POST"> <input type="hidden" name="id" value="<?= $bookmark->id; ?>"/> <?= htmlentities("$bookmark->url | $bookmark->title | $bookmark->tag"); ?> <button type="submit">Delete</button> diff --git a/src/templates/create.php b/src/templates/create.php index 21df9a8..7269b38 100644 --- a/src/templates/create.php +++ b/src/templates/create.php @@ -12,7 +12,7 @@ <h1>Bookmarks</h1> <h2>Add</h2> <a href="/">Back</a> - <form action="/store" method="POST"> + <form action="/store/" method="POST"> <?php require_once('form_fields.php'); ?> <button type="submit">Add</button> </form> diff --git a/src/templates/edit.php b/src/templates/edit.php index 5318c2c..639ce27 100644 --- a/src/templates/edit.php +++ b/src/templates/edit.php @@ -12,7 +12,7 @@ <h1>Bookmarks</h1> <h2>Edit</h2> <a href="/">Back</a> - <form action="/update" method="POST"> + <form action="/update/" method="POST"> <input type="hidden" name="id" value="<?= $bookmark->id; ?>"/> <?php require_once('form_fields.php'); ?> <button type="submit">Update</button> diff --git a/src/templates/index.php b/src/templates/index.php index ff67458..27f62b7 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -13,7 +13,7 @@ <?php if ($message) { ?> <p class="message"><?= $message; ?></p> <?php } ?> - <a href="/create">Add Bookmark</a> + <a href="/create/">Add Bookmark</a> <h2>Tags</h2> <ul> <a href="/">All</a> |
