noheader on the user/frontend side
You should be sending your header(s)/processing the request before the template loads. In fact, a hook was added specifically for this: template_redirect
You should be sending your header(s)/processing the request before the template loads. In fact, a hook was added specifically for this: template_redirect
Try something like this: header(“HTTP/1.0 404 Not Found”); $wp_query->set_404(); //This will inform WordPress you have a 404 – not absolutely necessary here, but for reference only. require ‘/path/to/404.php’; exit; Just do the error handling on the page itself instead of redirecting it to another template. This will maintain your 404 header and give you complete … Read more
You should solve this at the plugin level. While this rewrite rule … RewriteRule (.*)/?mysite.com/(.*) /$1/$2 [L,R=301] RewriteRule ^(.*)THUMB /$1 [L,R=301] … does what you are asking for, it is just cosmetic. Find the code that creates the wrong URL and fix that. Give the plugin author feedback; I’m sure s/he wants to know about … Read more
I found the solution here: http://pmg.co/a-mostly-complete-guide-to-the-wordpress-rewrite-api
Follow instructions on Giving WordPress Its Own Directory in Codex.
In the end I ended using mod_rewrite through .htaccess. The following is what I am using and so far is working well. RewriteCond %{HTTP_HOST} ^secure\.domain\.net$ RewriteRule (.*) http://www.domain.net/$1 [P,L]
Adding a conditional check such as, $current = “http://”.$_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”]; $mobile = “http://www.example.com/mobile”; if($current == $mobile) { //redirect to desired location } I’d provide more detail but am currently on mobile, so it’s difficult to write. See how you fair with the above.
It is going to be hard to give a solid answer without knowing exactly how you’ve cobbled things together but a preview always has preview=true in the URL. Just check that. if (isset($_GET[‘preview’]) && ‘true’ == $_GET[‘preview’]) { // send the page to WordPress } else { // load index.html I guess ? }
One of the most wasteful redirects happens frequently and web developers are generally not aware of it. It occurs when a trailing slash (/) is missing from a URL that should otherwise have one. For example, going to http://astrology.yahoo.com/astrology results in a 301 response containing a redirect to http://astrology.yahoo.com/astrology/ (notice the added trailing slash). This … Read more
I’m not entirely clear on what you’re trying to do, but I assume that your ‘bookmarks’ are named anchors in the page itself? And that including those anchor names in hash tags in the URL causes the browser to jump directly to the named anchor on the page rather than starting at the top and … Read more