Copy link to clipboard
Copied
<img src="/usr/home/crusader/public_html/crusaderoftexas.com/art/01/HOME_2-768x768.jpg" alt="crystal clear water for drinking with softener" width="768" height="768" title="clean water"/>
I'm working on a site and for some reason, rather than root-relative, the image source is showing as a function of the hosting root site. I am concerned that these links might break once the site goes live. Right now I'm using an IP address to create and manage the site. I have tried removing the path from the site settings for the web address and use only the IP address, but I left the root path in the root area of settings. I have also tried relative to document settings in the site, but the result is the same. When shorten the path to /art/01/Home.... etc. the image is not visible in DW but shows a missing image, although the image is there relative to root.
Is there any way to fix this issue?
This should read /public_html/
Copy link to clipboard
Copied
You can switch to Document Relative links by doing the following...
1. In DW, go to Site > Manage Sites
2. Click the site that's using root relative links to highlight it
3. Click the Edit button (pencil icon)
4. Click the chevron next to Advanced Settings to expand the options
5. Click Local Info
6. Set "Links relative to" to "Document"
7. Click Save
You will need to go through and manually repair existing links, but new ones will be written as Document Relative by the program.
Copy link to clipboard
Copied
I don't think you understand. I was already set to relative to Doc when I started seeing these long paths. So I switched to root relative and they were still there.
Copy link to clipboard
Copied
The shortened path you give, /art/01/Home..., is also root relative.
Copy link to clipboard
Copied
I think the problem is caused by your Local site folder. You cannot have public_html in your Local site. Move everything out of local public_html folder with DW's Files Panel. Delete that folder. DW will resolve link paths for you.
Hope that helps.
Copy link to clipboard
Copied
I don't have public_html in my local site folder The only place it exists is is in the root url in the site settings area when you are setting up servers for ftp as testing servers and regular uploads.
Copy link to clipboard
Copied
Public_html should not be in your local TESTING server.
Local server should be localhost. See screenshot.
Copy link to clipboard
Copied
I see now that this is a WordPress site. What are you doing in Dreamweaver?
To avoid problems, use absolute links to images on the server -- i.e. https :// yourdomain.com/ folder / filename.jpg (without spaces).
Copy link to clipboard
Copied
Hi, the site was a Wordpress site. I am setting it up with the IP address as a regular html site to avoid the security and maintenance issues of WP
Is this not correct? Should I not use a root directory? Then it won't upload properly?
Copy link to clipboard
Copied
be careful not to break the magic of WP by using absolute paths. Try to avoid them in your content, child templates and so on...
WP concedes this task to two of its properties (siteurl and home both located in wp_options table) and so if by any chance you were to change the structure of your site, an option to modify and the trick is done ... otherwise ... you must type in the database (plugin velvet blues) ... or in the SQL search replace ...
https://wordpress.org/support/article/changing-the-site-url/
have you try to use the path relative to the site but necessarily integrating the structure of WP
/wp-content/uploads/your-image.ext
think to add a .htaccess file to protect your uploads folder accordingly and if needed
google the subject, any article should be fine... I just digg one (not read) https://www.noupe.com/wordpress/how-to-protect-wordpress-files-and-uploads-folder.html
And finaly, in the site definition, just indicate your root folder, so that DW connects to the root ... that's all
Copy link to clipboard
Copied
THIS IS NOT A WP SITE. See http://216.146.223.21/
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Right, but as I said before, I'm redoing the website in a staging site that is NOT WP.
Copy link to clipboard
Copied
This should read /public_html/
Copy link to clipboard
Copied
Yes, you beat me to it. That is the correct path to use. 🙂