Attachment page 404 not found when image is attached to post
Attachment page 404 not found when image is attached to post
Attachment page 404 not found when image is attached to post
As per this issue on the WordPress trac, the problem are the rules 4 and 5. The solution is to change the url parameter and add 1, so, instead of this: <rule name=”WordPress Rule 4″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)” ignoreCase=”false” /> <action type=”Rewrite” url=”{R:1}” /> </rule> <rule name=”WordPress Rule 5″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$” ignoreCase=”false” /> <action … Read more
It’s a bit of a trick to get a WordPress site working within a framework of a non-Wordpress (html only) site in a fully-integrated way (though it can be done!). To keep things simple, I’d keep them pretty separate for the moment, which it sounds like you’re happy to do. So I guess you have … Read more
This has been an issue in core for a while, http://core.trac.wordpress.org/ticket/10722. The simplest solution is to just overwrite the headers on ‘template_redirect’. You can replace them as long as you haven’t started any output yet, which you shouldn’t have at this point. Just call status_header( 200 ); No cache headers are also sent when the … Read more
Jan Fabry wrote a very useful plugin that I think it would be helpful for you to analyze your rewrite rules.
post_status is part of the $post object which you can use to determine if it is published, a draft, pending, etc. if( $post->post_status == ‘pending’ ) // do stuff
I don’t think there’s anything fundamentally wrong with your approach, I see it pretty often. You could hook parse_request and 301 redirect any requests to footer to the front page. I wonder though how visitors would end up there in the first place, as long as you exclude it from the sitemap and don’t link … Read more
/wp-admin/ is an existing directory, your server just adds the missing /. /login is … nothing. The correct name is /wp-login.php. If you have enabled permalinks it should work though. To make /login always work add the following line to your .htaccess above the WordPress rules: Redirect Permanent /login /wp-login.php You can and should localize … Read more
Figured out the issue. It was with the generated “WordPress Rule 6”. It was giving 2 identical regex expressions. Removed the extra regex expression. Also had to remove “WordPress Rule 5”. Renumber the rules and now everything works fine. Here’s the updated web.config: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”WordPress Rule 1″ stopProcessing=”true”> … Read more
On every page load, WordPress executes these functions in their respective order: init(); parse_request($query_args); send_headers(); query_posts(); handle_404(); register_globals(); where the main query is finished after query_posts(). Note that in this point in time, WordPress knows the template AND all the query variables like max_num_pages. In handle_404(), if the main query has any posts, the function … Read more