-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment URL subdirectory is broken on same domain #573
Comments
Hi @chozze, I'd strongly suggest not using subdirectories for the WP hosting or deployment, the plugin struggles with them and I'm probably going to advertise that they're not supported. ideally:
Will close this as a "won't fix", but please let me know if you're planning to host your production site in a subdirectory or otherwise are struggling to find a setup that works for you and I'll offer some suggestions/alternatives. |
Thanks @leonstafford for replying, I would like to keep the static version in subdir of the site, so I guess eaiser solution is to write custom rewriter to run over all files again, replacing duplicated dirpath? thanks Ales |
@chozze that will probably work OK. You can tap into one of the hooks available https://wp2static.com/developers/extending-wp2static/ I'm still not sure of your intended use case, but if for example, you have an existing non-WP site at the naked domain and you want to export this site to your subdir within that site, you may look to use rewriting at the hosting end. ie, if using CloudFront, Netlify or Cloudflare, you can have all requests to |
@leonstafford it's a specific requirement for one client, who wants to use your plugin to generate a static site to specific directory on the same server. They will probably run another hooks after that to deploy it, zip it, archive it, or anything. Ales |
@chozze, sorry, I was being too quick to dismiss/shoot down the issue. Shortcomings in the plugin's current state shouldn't dictate what areas get ignored. Whilst I'd prefer to push the dev sites to not be hosted within a subdirectory (dev sites having more flexibility, as not so public facing), for the deployment URL, the plugin should support any combination of Now, thinking out loud based on recent work around URL rewriting, we have to deal with many types of links within a WP site
a FQURL is ideal, if we can rewrite all of those to one, else if our dev site is example.com and we leave a site root relative URL of The plugin's doing a much better job now of detecting and rewriting URLs and with some automated tests to validate different input/output HTML/CSS files, it should be easier to track down the issues you're facing and write up a fix. I'll try to get onto this soon and again, sorry for being a bit of a dick/dismissive of the issue! |
@leonstafford, no need to apologize at all! RIght now, I am doing a dirty workaround by genereting static site by
and after post processing is complete, I crawl the destination URL again and replace the placeholder with a real server path. |
I thought to keep on same server two virtualhost name dev.example.com at
And example.com static under
I am not sure what can goes wrong with this. I feel this can save server cost if someone want 'author' role support (keeping WP online, pass protected) while enjoying benefit of static for public domain. Do you think this approach can do faster deployment? As it may not need SFTP addon kind of thing if dir permission are same www-data:www-data for all two virtualhost root paths. |
Hi, I'm running version 7.0-alpha-007 and if I insert subdirectory under same domain, eg. on webserver http://example.com and Deployment URL is set to http://example.com/static then generated links are http://example.com/static/static/... instead of http://example.com/static/...
SimpleRewriter.php is broken
Thanks for your help, Ales
The text was updated successfully, but these errors were encountered: