Support » Fixing WordPress » “Press This” results in 404

  • 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.

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter rnawky

    (@rnawky)

    Bump

    Thread Starter rnawky

    (@rnawky)

    Bump

    Thread Starter rnawky

    (@rnawky)

    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.

    Thread Starter rnawky

    (@rnawky)

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

    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.

    Thread Starter rnawky

    (@rnawky)

    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.

    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.

    Thread Starter rnawky

    (@rnawky)

    Nope, neither one of those helped.

    Still having this problem.

    Thread Starter rnawky

    (@rnawky)

    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.

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

    Thread Starter rnawky

    (@rnawky)

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

    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.

    Thread Starter rnawky

    (@rnawky)

    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.

    aaronrogers

    (@aaronrogers)

    Try this…
    Edit the text in the “Press This” link

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

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

    Thread Starter rnawky

    (@rnawky)

    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.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘“Press This” results in 404’ is closed to new replies.