WordPress.org

Ready to get started?Download WordPress

Forums

"Press This" results in 404 (22 posts)

  1. rnawky
    Member
    Posted 5 years ago #

    When I try to use the "Press This" shortcut to my self hosted blog, I get the following error.

    Forbidden

    You don't have permission to access /wordpress/wp-admin/press-this.php on this server.

    However, if I remove all the parameters after press-this.php, the page will load just fine. I only get this error when

    Example:
    /wordpress/wp-admin/press-this.php?u=http%3A%2F%2Fwww.google.com%2F&t=Google&s=&v=2
    404 Error

    /wordpress/wp-admin/press-this.php
    Load blank form to add a press.

  2. rnawky
    Member
    Posted 5 years ago #

    Bump

  3. rnawky
    Member
    Posted 5 years ago #

    Bump

  4. rnawky
    Member
    Posted 5 years ago #

    Well since no one seems to be helping, I narrowed down the error.

    It only produces a 404 error with %3A (:) is in the u= part of the URL.

    Example:

    404 Error:
    press-this.php?u=http%3A%2F%2Fwww.google.com%2F&t=Google&s=&v=2

    Works as intended:
    press-this.php?u=www.google.com%2F&t=Google&s=&v=2

    Can someone please shine some light on this problem.

  5. rnawky
    Member
    Posted 5 years ago #

    This really isn't the best place to get support, is it?

  6. ClaytonJames
    Member
    Posted 5 years ago #

    This really isn't the best place to get support, is it?

    Just the opposite, in my opinion. Stick around a while and see.

    Some of your unknown variables: (to anyone trying to help)

    -Are you trying to access your server, from the servers browser?
    -IIS or Apache?
    -Mod_rewrite or no?
    -Are you inside or outside of your own network when it occurs?

    "Self hosted" servers have so many different configurations and usually, so many configuration errors at first, that few people will want to try and diagnose your setup problems. Windows? Linux? Mod_rewrite issues? Permalinks or file permissions? Who can say.

    From a machine on my network, I just dragged the "press this" link to my toolbar, logged out of WordPress (on a dev server sitting under my desk), then hit the press this link, and it took me right to my log in. The javascript (I believe it is a javascript) worked perfectly, first try. So who can say?

    Here is the url my "press this" link used for access just for comparison:

    //www.mytestblog.com/wp-admin/press-this.php?u=http%3A%2F%2Fwww.google.com%2F&t=Google&s=&v=2

    BUT... this works as well:

    //www.mytestblog.com/wp-admin/press-this.php

    Your method also worked for me, however all it is doing for me is redirecting and then opening login.php, then press-this.php in a browser window and completely bypassing the javascript popout window.

    So you can see why it's difficult to tell exactly what your particular roadblock may be. Frankly, I don't think you fixed it. I think you worked around the javascript issue.

    Best wishes.

  7. rnawky
    Member
    Posted 5 years ago #

    The server isn't on my network.
    It's Apache
    And I have mod_rewrite
    And it works fine

    The problem only occurs when there's a colon in the url which I can't seem to understand.

  8. ClaytonJames
    Member
    Posted 5 years ago #

    Here is what is in the forums if you do a search.

    http://wordpress.org/search/press-this.php?forums=1

    Here is one solution that was related to mod_rewrite:

    http://wordpress.org/support/topic/190089?replies=7#post-931195

    Here is one solution claiming to be related to mod_security:

    http://wordpress.org/support/topic/207142?replies=3#post-869037

    Perhaps information in those threads will shed some more light on why you are having similar symptoms.

  9. rnawky
    Member
    Posted 5 years ago #

    Nope, neither one of those helped.

    Still having this problem.

  10. rnawky
    Member
    Posted 5 years ago #

    The file never even gets accessed when there's a : in the url.

    I tried putting die('test'); on the top of the press_this.php file and still got a 404 error. Manually removing the : from the URL showed the die message.

  11. ClaytonJames
    Member
    Posted 5 years ago #

    Anything of value in your error log when it 403's or 404's on you?

  12. rnawky
    Member
    Posted 5 years ago #

    No, PHP error log has no 404 pages logged since WordPress handles the 404.

  13. ClaytonJames
    Member
    Posted 5 years ago #

    Perhaps my thought process isn't quite on track here, but I'm thinking along the lines that if "log_errors" in php.ini is set to on, and "display_errors" is set to off, and it (php) is sending the generated errors to apache's default error log, (or the error log defined for your virtual host) then depending on where you left your httpd.conf "LogLevel" directive set for error logging, there should be some telling information in that error log. Or you might be able to change the error logging level long enough to assist in debugging the problem.

  14. rnawky
    Member
    Posted 5 years ago #

    log_errors is on and no 404 error displays in it when I try to access press_this.php

    Here's what it looks like in the access log

    [12/Feb/2009:14:40:30 -0600] "GET /wordpress/wp-admin/press-this.php?u=http%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2F239331%3Freplies%3D12%23post-983906&t=WordPress%20%E2%80%BA%20Support%20%C2%BB%20%22Press%20This%22%20results%20in%20404&s=&v=2 HTTP/1.1" 404 1019 "http://wordpress.org/support/topic/239331?replies=12" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6"

    And once again, if I remove that %3A from the URL, the page will load.

  15. aaronrogers
    Member
    Posted 5 years ago #

    Try this...
    Edit the text in the "Press This" link

    Replace:
    u='+e(l.href)+'

    With:
    u='+e(l.href.replace(/\//g,'\\/'))+'

  16. rnawky
    Member
    Posted 5 years ago #

    Thanks aaronrogers that seemed to do the trick. I have no idea why it wouldn't work as before. Must be a server configuration problem.

    When I use it on this page, u equals http%3A\%2F\%2Fwordpress.org\%2Fsupport\%2Ftopic\%2F239331

    But apparently those backslashes don't mess up the actual url in the entry, as they get parsed into forward slashes.

    Anyways thanks again.

  17. jeffvand
    Member
    Posted 5 years ago #

    This worked for me too as a solution. Thanks @aaronrogers!

  18. mtrolley
    Member
    Posted 5 years ago #

    This worked for me as well. Thanks.

    What I'd really like to know is what the underlying issue is though. Why does it not work for a few of us but it does for most people?

    I'm having a similar problem with logging in with OpenID so I wonder if it's the same issue causing both problems.

    FYI I'm using GatorHost, in case it might have something to do with the serverside software.

  19. LikaStarr
    Member
    Posted 4 years ago #

    Another "Thank You" I also use HostGator.

  20. JEDs
    Member
    Posted 4 years ago #

    Ditto: Hostgator;worked

    Thanks!
    JEDs

  21. klintron
    Member
    Posted 4 years ago #

    Does anyone know of a version of aaronrogers's fix that works with 2.9 beta2? The script is slightly different and the fix breaks it entirely.

  22. stevejohnson
    Member
    Posted 4 years ago #

    The underlying issue, at least on HostGator, is their mod_security settings.

    If you get on their live chat support, they'll whitelist your domain for the specific rule that's causing this.

Topic Closed

This topic has been closed to new replies.

About this Topic