Destination URL blank introduces href='http://example.com...'
I'm trying to export a WP site to static content with relative URLs that I can first publish into a staging area before copying it to production. Hence I'm leaving "Destination URL" empty to purely get relative URLs for all content.
Most of the content works well but some elements get 'http://example.com' as as prefix. Can this be prevented?
I have an example on an IMG element srcset=... (https://html.com/attributes/img-srcset/)
- 7 replies
- Leon Stafford @leonstafford2019-01-08 16:14:11.211Z
Thanks for using the plugin. Let's see if we can get your exports working smoothly.
You may try the destination URL as a
/. And ensure the "generate ZIP for offline use" is not checked.
Please let me know if that helps.
For any URLs still not being rewritten, please share me the original source code surrounding the link in question, so I can do some testing / fashion a fix if required.
Thanks Leon, tried that but no luck. I'm exporting to a directory and no ZIP generated.
I've set "Base HREF" to '/' as well as "Destination URL" to '/' and "Use relative URLs" is ON
The source element that fails is:
which results now in
If you could provide a fix would be great !!!
- In reply toleonstafford⬆:
Just noticed that the elements aren't displayed as I was hoping for - the element looks like
<img src="http://wordpress.domain.com/wp-content/uploads/2018/12/undraw_country_side_ayop.png" class=" wp-post-image wp-image-2707" alt="undraw_country_side_ayop" srcset="http://wordpress.domain.com/wp-content/uploads/2018/12/undraw_country_side_ayop.png 1367w, http://wordpress.int.hekla.io/wp-content/uploads/2018/12/undraw_country_side_ayop-300x207.png 300w, http://wordpress.domain.com/wp-content/uploads/2018/12/undraw_country_side_ayop-768x530.png 768w, http://wordpress.domain.com/wp-content/uploads/2018/12/undraw_country_side_ayop-1024x706.png 1024w" sizes="(max-width: 1367px) 100vw, 1367px" />
and ends up like:
<img src="../wp-content/uploads/2018/12/undraw_country_side_ayop.png" class=" wp-post-image wp-image-2707" alt="undraw_country_side_ayop" srcset="http://example.com/wp-content/uploads/2018/12/undraw_country_side_ayop.png 1367w, http://example.com/wp-content/uploads/2018/12/undraw_country_side_ayop-300x207.png 300w, http://example.com/wp-content/uploads/2018/12/undraw_country_side_ayop-768x530.png 768w, http://example.com/wp-content/uploads/2018/12/undraw_country_side_ayop-1024x706.png 1024w" sizes="(max-width: 1367px) 100vw, 1367px">
Let me know if you have any workaround to get the correct replacement here
- Leon Stafford @leonstafford2019-01-23 03:10:34.792Z
I'll look into this further, thanks for the example HTML code.
In the meantime, if you can try with this latest build:https://github.com/leonstafford/wp2static/releases/tag/next_release_preview
I'd like to know if you choose the Offline ZIP option, if that gives you a fine-looking export for local use? That will give me a bit more of an indicator of the scope of the issue.
- Leon Stafford @leonstafford2019-01-26 02:27:05.876Z
Hi @sopeters, sorry for the late reply.
For your WordPress development site, is it http or https when you access it? Also, does that match what's in the Settings screen for Site URL and Home fields?
I am working on a Debug Mode for the next version, which may help us pinpoint the issue..