Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] replace %20% usernames with a dash (-) in URL?

@halo-diehard

Participant

Thanks so much for your response! First I created bp-custom.php and pasted define( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’, true ); into it, then I put it in my plugins folder, and I got the same 404 except this text was across the top of the page:

define( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’, true );
Warning: Cannot modify header information - headers already sent by (output started at /homepages/33/(database here)/htdocs/(mywordpressfolder)/wp-content/plugins/bp-custom.php:1) in /homepages/33/(database here)/htdocs/(mywordpressfolder)/wp-includes/pluggable.php on line 1121

By sheer luck I recognized that the ‘ and ‘ were the curly ones, and I had JUST read about that last week, so I deleted the apostrophe’s and typed them in myself in notepad++, crossing my fingers. But when I saved and ftp’d the new file, I had the same thing across the top, just with the fixed code!

define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );
Warning: Cannot modify header information - headers already sent by (output started at /homepages/33/(database here)/htdocs/(mywordpressfolder)/wp-content/plugins/bp-custom.php:1) in /homepages/33/(database here)/htdocs/(mywordpressfolder)/wp-includes/pluggable.php on line 1121

I went and took a peek at pluggagle.php, line 1121, and it is the third line up from this:

	/**
	 * Filter the redirect status code.
	 *
	 * @since 2.3.0
	 *
	 * @param int    $status   Status code to use.
	 * @param string $location The path to redirect to.
	 */
	$status = apply_filters( 'wp_redirect_status', $status, $location );

	if ( ! $location )
		return false;

	$location = wp_sanitize_redirect($location);

	if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
		status_header($status); // This causes problems on IIS and some FastCGI setups

	header("Location: $location", true, $status);

	return true;
}
endif;

So 1121 is this bit: header("Location: $location", true, $status);

That block of code is just above “Sanitizes a URL for use in a redirect”, using function wp sanitize redirect.

Not sure if any of that points to any clear problem, but it’s pretty much Greek to me 🙁

Skip to toolbar