Can we redirect to an arbitrary page when accessing a file without viewing permission?
This can be achieved with constant settings. Set "LOGIN_URL_FOR_LTD" and enter the URL to redirect to as the value.
Settings
Click [Add] in [Environment Settings] -> [Constants].
Settings Value
Set the following values:
- Name: LOGIN_URL_FOR_LTD
- Value: URL to redirect to
Once the settings are complete, when you access a file without viewing permission, it will be redirected to the specified URL instead of showing "NotFound". In addition, the URL of the redirect source is added as a query parameter.
Example
Redirect source URL:
https://example.g.kuroco-img.app/files/ltd/test/test_file.pdf
Redirect destination URL:
https://www.diverta.co.jp/?return_url=https%3A%2F%2Fexample.g.kuroco-img.app%2Ffiles%2Fltd%2Ftest%2Ftest_file.pdf
Support
If you have any other questions, please contact us or check out Our Slack Community.