(bug?) Prepare Print Page btn resolves to root
-
My WP site is in a sub folder, like this: https://www.website.com/blog/wp-admin/…..
When clicking on Prepare Print Page I get an error. Somehow the form redirects to root, landing outside my WP install. Like this: https://www.website.com/blog?…..
If I manually change the URL to https://www.website.com/blog/blog?… it works.
The page I need help with: [log in to see the link]
-
Hi @nc_nc! That’s totally a bug and totally embarrassing! I’m pretty sure I know what the issue is and will fix it in the next day or two (🤞).
Thanks for reporting it.Hmmm actually looking into the code, it should be sending you to the correct URL.
If you can provide the link to the site where you’re having this issue that may give me some clues.
What do you have set in settings for “WordPress Address (URL)” and “Site Address (URL)”?My setup is a bit complicated. I am using Apache to Proxy to IIS. I am on a Win OS.
Apache config:
<IfModule mod_proxy.c> ProxyRequests Off ProxyPass /blog ! ProxyPass /mail ! ProxyPass / http://127.0.0.1:8080/ssl/ ProxyPassReverse / http://127.0.0.1:8080/ssl/ RewriteRule ^(.+)$ https://www.filmfix.com/$1 [P,L] </IfModule> <Directory "C:/wordpress"> DirectoryIndex index.php RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] Require all granted </Directory>
WordPress Address (URL) and Site Address (URL) are the same: https://www.filmfix.com/blog
Hmmmm @nc_nc are you still reproducing the issue? I just tried using Print My Blog from a local site that’s in a subdirectory and it worked fine. Also everything looks in order on your site…
Are you handy with your browser’s web inspector? If so, on the print setup page (the page with the form that you submit) can you check what theform
tag’s “action” value is? I made a short screen recording of me doing it with Google Chrome: https://drive.google.com/file/d/1x04uQihfYLM6MdL7XF3Dmw13zIgFlvvi/view (I admit I was mumbling, trying to not wake the kiddies!) Tip: it’s easiest to find the “form” tag if you right click on “Show Options”.The form action value is
<form action="https://www.filmfix.com/blog" method="get">
, but in my case it should go to<form action="https://www.filmfix.com/blog/blog" method="get">
.Hmm after about an hour investigating I think I found the issue @nc_nc: I think you actually have the site’s “WordPress URL” and “Home URL” set to filmfix.NET.
If I go to filmfix.com/blog, it triggers the Print My Blog print page, but the browser is suspecting an cross-site scripting attack because the requests for post data are going to filmfix.NET.
but this URL with filmfix.NET DOES work:
So I think you need to either change the “WordPress URL” to filmfix.net/blog, or enable CORS on your site. Does that make sense?
Sorry for that – I am still new to WP. Yes, you are right .net workings.
I will try adding:
<? header("Access-Control-Allow-Origin: *"); ?>
on the file api.php and see what I get.I will try adding: <? header(“Access-Control-Allow-Origin: *”); ?> on the file api.php and see what I get.
I was about to make a suggestion about this, but it looks like you switched the “WordPress URL” and “Site URL” to “filmfix.COM”, which is probably the most straightforward fix.
But I also see you deactivated Print My Blog (which is fine, seeing how it seems to have been a test site with nothing to print yet, and it’s always good to deactivate unused plugins.)
If I’ve been of help getting this sorted out, a positive review would be appreciated.
Take care!
These links you provided exposed password protected posts!
Is the plugin suppose to work like that? I hope not. This is the reason why I deactivated the plugin.
I have all my posts setup in another “category” (not sure if this is the right word for it.) So only had a few tester posts in Posts.
It never shows password protected/private posts to users who don’t have permission to see them. Log out and try the URLs again: you won’t see the password protected posts.
If you want to exclude password-protected posts even for yourself, uncheck “Include Password-Protected and Private Posts” on the print setup page.good to know. Thank you.
My issue was really all that I needed to have a way to be able to print out the post. Somehow the template (theme) did not allow to print passed the 2nd page. I have it printed now so I do not really need to keep your (useful) plugin activated.
Thank you for all the very helpful support.
- The topic ‘(bug?) Prepare Print Page btn resolves to root’ is closed to new replies.