Changeset 7990 for trunk/wp-includes/canonical.php
- Timestamp:
- 05/25/2008 03:45:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/canonical.php
r7916 r7990 3 3 * Canonical API to handle WordPress Redirecting 4 4 * 5 * Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference" by Mark Jaquith 5 * Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference" 6 * by Mark Jaquith 6 7 * 7 8 * @author Scott Yang … … 12 13 13 14 /** 14 * redirect_canonical() - Redirects incoming links to the proper URL based on the site url 15 * 16 * Search engines consider www.somedomain.com and somedomain.com to be two different URLs 17 * when they both go to the same location. This SEO enhancement prevents penality for 18 * duplicate content by redirecting all incoming links to one or the other. 19 * 20 * Prevents redirection for feeds, trackbacks, searches, comment popup, and admin URLs. 21 * Does not redirect on IIS, page/post previews, and on form data. 22 * 23 * Will also attempt to find the correct link when a user enters a URL that does not exist 24 * based on exact WordPress query. Will instead try to parse the URL or query in an attempt 25 * to figure the correct page to go to. 15 * Redirects incoming links to the proper URL based on the site url 16 * 17 * Search engines consider www.somedomain.com and somedomain.com to be two 18 * different URLs when they both go to the same location. This SEO enhancement 19 * prevents penality for duplicate content by redirecting all incoming links to 20 * one or the other. 21 * 22 * Prevents redirection for feeds, trackbacks, searches, comment popup, and 23 * admin URLs. Does not redirect on IIS, page/post previews, and on form data. 24 * 25 * Will also attempt to find the correct link when a user enters a URL that does 26 * not exist based on exact WordPress query. Will instead try to parse the URL 27 * or query in an attempt to figure the correct page to go to. 26 28 * 27 29 * @since 2.3 … … 29 31 * @uses $is_IIS 30 32 * 31 * @param string $requested_url Optional. The URL that was requested, used to figure if redirect is needed. 33 * @param string $requested_url Optional. The URL that was requested, used to 34 * figure if redirect is needed. 32 35 * @param bool $do_redirect Optional. Redirect to the new URL. 33 * @return null|false|string Null, if redirect not needed. False, if redirect not needed or the string of the URL 36 * @return null|false|string Null, if redirect not needed. False, if redirect 37 * not needed or the string of the URL 34 38 */ 35 39 function redirect_canonical($requested_url=null, $do_redirect=true) { … … 212 216 213 217 /** 214 * redirect_guess_404_permalink() - Tries to guess correct post based on query vars218 * Attempts to guess correct post based on query vars 215 219 * 216 220 * @since 2.3 217 221 * @uses $wpdb 218 222 * 219 * @return bool|string Returns False, if it can't find post, returns correct location on success. 223 * @return bool|string Returns False, if it can't find post, returns correct 224 * location on success. 220 225 */ 221 226 function redirect_guess_404_permalink() {
Note: See TracChangeset
for help on using the changeset viewer.