You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copyright (c) 2022, 2024 Oracle and/or its affiliates.
3
+
Copyright (c) 2022, 2025 Oracle and/or its affiliates.
4
4
5
5
Licensed under the Apache License, Version 2.0 (the "License");
6
6
you may not use this file except in compliance with the License.
@@ -369,6 +369,22 @@ server:
369
369
370
370
See xref:{rootdir}/config/io_helidon_webserver_staticcontent_StaticContentFeature.adoc[Static Content Feature Configuration Reference] for details. The only difference is that we set welcome file to `index.html` by default.
371
371
372
+
=== Re-direct root using `server.base-path`
373
+
374
+
To redirect requests for the root path (`/`) to another path you can use the `server.base-path` property:
375
+
376
+
[source,yaml]
377
+
----
378
+
server:
379
+
base-path: /static/index.html
380
+
----
381
+
382
+
For any HTTP request for `/` this will return a 301 with the `Location:` header set to the value of `server.base-path`.
383
+
This is often used with Static Content Support to serve a specific `index.html` when `/` is requested.
384
+
385
+
Note that this feature is not for setting a context root for applications. To configure alternate context roots see
386
+
see xref:jaxrs/jaxrs-applications.adoc#_setting_application_path[Setting Application Path].
0 commit comments