Custom pages don't work with base_url setting
See original GitHub issueIt seems that custom pages aren’t routing properly when the base_url
setting is used.
To reproduce, with Datasette 0.55.
Create a templates/pages/custom.html
with some text.
mkdir -p templates/pages/
echo "Hello, world!" > templates/pages/custom.html
Start Datasette.
datasette --template-dir templates/
Visit http://localhost:8001/custom and see “Hello, world!”.
Start Datasette with a base_url
.
datasette --template-dir templates/ --setting base_url /prefix/
Visit http://localhost:8001/prefix/custom and see a “Database not found: custom” 404.
Note that like all routes, http://localhost:8001/custom still works when run with base_url
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Github pages ignores Jekyll's baseurl for custom subdomain
Problem is that it doesn't work in production. Github pages completely ignores the baseurl and keeps trying to serve it at sub.domain.com ....
Read more >site.baseurl behaviour specific to GitHub Pages · Issue #350
The problem is that an empty baseurl is overridden on GitHub Pages, but not a non-empty one. The behaviour is not exactly the...
Read more >[fastpages] resources of the page won't load when use custom ...
I have created a new repo which give me a page at https://[username].github.io/[repo] it works perfectly. But when I set it up with...
Read more >docusaurus.config.js
Defaults to the locale's name. Note: this has no effect on the locale's baseUrl —customization of base URL is a work-in-progress. noIndex ...
Read more >Configuration - Intuit Developer
The SDK allows you to define custom, local app settings in the sdk.config file. ... A base URL defines the work environment accessed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rgieseke Ah, that’s super helpful. Thank you for the workaround for now!
Alternative idea: populate
request.scope
with a newroute_path
which is the base-url-stripped version, which we then use for other routing operations.