| [ Index ] |
PHP Cross Reference of Wordpress 2.9.1 |
[Source view] [Print] [Project Stats]
Canonical API to handle WordPress Redirecting Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference" by Mark Jaquith
| Author: | Scott Yang |
| Author: | Mark Jaquith |
| File Size: | 345 lines (15 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| redirect_canonical($requested_url=null, $do_redirect=true) X-Ref |
| Redirects incoming links to the proper URL based on the site url. Search engines consider www.somedomain.com and somedomain.com to be two different URLs when they both go to the same location. This SEO enhancement prevents penality for duplicate content by redirecting all incoming links to one or the other. Prevents redirection for feeds, trackbacks, searches, comment popup, and admin URLs. Does not redirect on IIS, page/post previews, and on form data. Will also attempt to find the correct link when a user enters a URL that does not exist based on exact WordPress query. Will instead try to parse the URL or query in an attempt to figure the correct page to go to. param: string $requested_url Optional. The URL that was requested, used to param: bool $do_redirect Optional. Redirect to the new URL. return: null|false|string Null, if redirect not needed. False, if redirect |
| redirect_guess_404_permalink() X-Ref |
| Attempts to guess correct post based on query vars. return: bool|string Returns False, if it can't find post, returns correct |
| Generated: Fri Jan 8 00:19:48 2010 | Cross-referenced by PHPXref 0.7 |