relative paths dont work when publishing
After publishing my site thru sftp:
My folder structure on cascade looks like this:
base:
_files/home/inlinescripts.js
_internalFiles/pages/home.html
on my template (page.html uses it) I have the following:
<script src="/_files/home/inLineScripts.js"></script>
after publishing my home.html becomes:
<script src="../../_files/home/inLineScripts.js"></script>
If I try to open the published file I get a not found error:
_internal/pages/_files/home/inLineScripts.js Failed to load resource: the server responded with a status of 404 (Not Found)
How can I make fix the paths when publishing?
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 13 May, 2016 04:13 PM
Hi,
Be default, all internal links will be written as relative when publishing pages and files; unless those links are pointing to an asset within a different Site.
If you need to publish using absolute links, edit the page or file, click the System pane, and check the Maintain Absolute Links option.
Note: this is a per-asset option, so you would need to ensure this option is enabled for each page or file that needs absolute links.
That being said, relative links for style and script resources should work; the absolute option is usually necessary for subdomains or server-side includes. Perhaps there is a permission or configuration issue on the web server itself that is preventing the file from being served to the browser.
Please let me know if you have any questions.
Thanks!
2 Posted by latorresescobed... on 13 May, 2016 04:15 PM
thanks for the reply, although my error was a hidden base tag in the layout. Everything is working now.
3 Posted by Ryan Griffith on 13 May, 2016 05:02 PM
Not a problem at all, thank you for following up. I am glad to hear you were able to track down the issue.
Have a great day!
Ryan Griffith closed this discussion on 13 May, 2016 05:02 PM.