<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress support forums Tag: rewriterule</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Tag: rewriterule</description>
<language>en</language>
<pubDate>Tue, 02 Dec 2008 13:02:12 +0000</pubDate>

<item>
<title>Achilleus on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-18076</link>
<pubDate>Fri, 08 Aug 2008 21:27:48 +0000</pubDate>
<dc:creator>Achilleus</dc:creator>
<guid isPermaLink="false">18076@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Would I be able to use the pretty URLs with this somehow?  Or maybe exclude the entire directory of /bbpress/ from wordpress's URL thing?&#60;/p&#62;
&#60;p&#62;Using WMPU btw
&#60;/p&#62;</description>
</item>
<item>
<title>mrhoratio on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-16116</link>
<pubDate>Sat, 10 May 2008 08:35:49 +0000</pubDate>
<dc:creator>mrhoratio</dc:creator>
<guid isPermaLink="false">16116@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Sambauers,&#60;/p&#62;
&#60;p&#62;As you suggested, I was able to modify get_user_profile_link() function in template-functions.php to prevent the redirection. Mod_rewrite will now rewrite to the profile page properly, without redirecting it. &#60;/p&#62;
&#60;p&#62;But now, it shows I'm no longer logged in when I'm on a rewritten page, even though I am. When I try to log in. It just reloads the page.&#60;/p&#62;
&#60;p&#62;Here's the mod in_user_profile_link():&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function get_user_profile_link( $id = 0, $page = 1 ) {
	$user = bb_get_user( bb_get_user_id( $id ) );
	$rewrite = bb_get_option( &#38;#39;mod_rewrite&#38;#39; );
	if ( $rewrite ) {
		if ( $rewrite === &#38;#39;slugs&#38;#39; ) {
			$column = &#38;#39;user_nicename&#38;#39;;
		} else {
			$column = &#38;#39;ID&#38;#39;;
		}
		$r = bb_get_option(&#38;#39;uri&#38;#39;) . &#38;quot;profile/&#38;quot; . $user-&#38;gt;$column . ( 1 &#38;lt; $page ? &#38;quot;/page/$page&#38;quot; : &#38;#39;&#38;#39; );
	} else {
		$r = bb_get_option(&#38;#39;uri&#38;#39;) . &#38;quot;profile/&#38;quot; . $user-&#38;gt;$column . ( 1 &#38;lt; $page ? &#38;quot;/page/$page&#38;quot; : &#38;#39;&#38;#39; );

	}
		$r = str_replace(&#38;#39;forums/profile/&#38;#39; . $user-&#38;gt;$column , &#38;quot;profile/&#38;quot; . $user-&#38;gt;$column, $r);
		return apply_filters( &#38;#39;get_user_profile_link&#38;#39;, $r, $user-&#38;gt;ID );

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;My goal is create a short URL such as &#60;a href=&#34;http://www.example.com/profile/username&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/profile/username&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>RyanNutt on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-15393</link>
<pubDate>Tue, 15 Apr 2008 10:44:14 +0000</pubDate>
<dc:creator>RyanNutt</dc:creator>
<guid isPermaLink="false">15393@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Works great, although I added a couple of rewrite rules. &#60;/p&#62;
&#60;p&#62;/forum/profile to /forum/profile.php and /forum/tags to /forum/tags.php&#60;/p&#62;
&#60;p&#62;The profile and tags pages were still returning 404 headers.
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-14906</link>
<pubDate>Wed, 02 Apr 2008 21:09:35 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">14906@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;No listing in the plugins tab means the plugin is malformed and is seen as just a file in that directory, not a plugin.  You are going to need a plugin header, something as simple as this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
/*
Plugin Name: No 404s
*/
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;a href=&#34;http://codex.wordpress.org/Writing_a_Plugin&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Writing_a_Plugin&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>icesar on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-14899</link>
<pubDate>Wed, 02 Apr 2008 18:19:10 +0000</pubDate>
<dc:creator>icesar</dc:creator>
<guid isPermaLink="false">14899@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Thanks for the reply Chris.  Yes, I'm using 2.3.3 right now.  The content of the plugin code is exactly as above:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function mbob_flush_rewrites() {
	global $wp_rewrite;
	$wp_rewrite-&#38;gt;flush_rules();
}
add_action(&#38;#39;init&#38;#39;, &#38;#39;mbob_flush_rewrites&#38;#39;);

function mbob_add_rewrites($wp_rewrite) {
	add_rewrite_rule(&#38;#39;forums/topic&#38;#39;, &#38;#39;forums/topic.php&#38;#39;);
	add_rewrite_rule(&#38;#39;forums/forum&#38;#39;, &#38;#39;forums/forum.php&#38;#39;);
	add_rewrite_rule(&#38;#39;forums&#38;#39;, &#38;#39;forums/index.php&#38;#39;);
	$wp_rewrite-&#38;gt;rules = array_merge($wp_rewrite-&#38;gt;non_wp_rules, $wp_rewrite-&#38;gt;rules);
}
add_action(&#38;#39;generate_rewrite_rules&#38;#39;, &#38;#39;mbob_add_rewrites&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And I'm not getting a specific error really.  Simply that when I upload no404s.php with this code to my wp-content/plugins directory, there is no listing in the Plugins tab to even activate it.
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-14885</link>
<pubDate>Tue, 01 Apr 2008 21:59:57 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">14885@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;What does the content of your plugin look like, and what is the error you are getting when you try to activate it (do you have access to error logs)?  Also, what version WordPress are  you using( 2.3.3?)
&#60;/p&#62;</description>
</item>
<item>
<title>icesar on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-14883</link>
<pubDate>Tue, 01 Apr 2008 21:19:08 +0000</pubDate>
<dc:creator>icesar</dc:creator>
<guid isPermaLink="false">14883@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;So close!  I have this same issue with my regular installation of WP, and I only realized today (after 3 months) that this is the reason my forums - &#60;a href=&#34;http://argentinastravel.com/forums/&#34; rel=&#34;nofollow&#34;&#62;http://argentinastravel.com/forums/&#60;/a&#62; - are not getting indexed!&#60;/p&#62;
&#60;p&#62;I tried creating a plugin from the code above, but I couldn't activate it.  Can someone please help me with a step by step fix for a regular WP install?   Gracias!
&#60;/p&#62;</description>
</item>
<item>
<title>vilimaunula on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-14027</link>
<pubDate>Sun, 24 Feb 2008 10:00:28 +0000</pubDate>
<dc:creator>vilimaunula</dc:creator>
<guid isPermaLink="false">14027@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Brilliant, absolutely brilliant. I had already got to the stage of banging my head against the wall a few times because of this, but now it's finally sorted out and my forums don't throw up those nasty 404s when validating and being indexed by search engines.&#60;/p&#62;
&#60;p&#62;Thanks, beaulebens!
&#60;/p&#62;</description>
</item>
<item>
<title>beaulebens on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-13360</link>
<pubDate>Fri, 25 Jan 2008 05:53:37 +0000</pubDate>
<dc:creator>beaulebens</dc:creator>
<guid isPermaLink="false">13360@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;@starnet - The best way is to have it in an auto-load WPMU plugin, which means stick it in a file called &#34;no-404s.php&#34;  or something in wp-content/mu-plugins/.
&#60;/p&#62;</description>
</item>
<item>
<title>starnet on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-13184</link>
<pubDate>Wed, 16 Jan 2008 18:32:03 +0000</pubDate>
<dc:creator>starnet</dc:creator>
<guid isPermaLink="false">13184@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Beau,&#60;/p&#62;
&#60;p&#62;Which files should you put this code on?  I am also installing bbPress on a MU Wordpress.  I get the same error.  I thought maybe it's because of WP/MU not compatible with bbPress.   I have the same install directories (WP/MU on root and bbPress on /forums/).  And I am getting the same 404 error on user profile and post. &#60;/p&#62;
&#60;p&#62;Thanks in advance
&#60;/p&#62;</description>
</item>
<item>
<title>beaulebens on "bbPress + WordPress (mu or not) leads to 404 errors, but p"</title>
<link>http://bbpress.org/forums/topic/bbpress-wordpress-mu-or-not-leads-to-404-errors-but-pages-still-load#post-13156</link>
<pubDate>Mon, 14 Jan 2008 21:45:19 +0000</pubDate>
<dc:creator>beaulebens</dc:creator>
<guid isPermaLink="false">13156@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;&#60;strong&#62;Background:&#60;/strong&#62; Installed WPMU (at &#34;/&#34;) and bbPress (at &#34;/forums/&#34;), followed integration instructions (and tweaked to get it all working). I used my WP theme header.php and footer.php as the basis for a bbPress theme, and loaded the full WP engine into bbPress by putting this code in my config.php&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// Load Wordpress so we can use the same templates.
define(&#38;#39;WP_BB&#38;#39;, &#38;#39;true&#38;#39;);
require_once dirname(dirname(__FILE__)) . &#38;#39;/wp-blog-header.php&#38;#39;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;strong&#62;Symptoms:&#60;/strong&#62; Pages load just fine, and all appears successful, &#60;em&#62;but&#60;/em&#62;, upon further inspection, all bbPress pages actually return a 404 error in the HTML headers (you can see this using FireBug, or using a HEAD command to the page). NOTE: This will also happen if you create custom pages (not WP &#34;Pages&#34;) that load the WordPress engine - they load fine, but actually throw a 404).&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;Explanation:&#60;/strong&#62; What appears to be happening here, is that the page loads fine, because it is a real page. Internally however, WP doesn't know about this page (because it's a bbPress, or custom page), and so it assumes it's a request for a permalink that it can't resolve. Thus it throws a 404.&#60;/p&#62;
&#60;p&#62;The internal rewrite system in WP allows you to add new rewrite rules, but appears to only like dealing with &#34;internal&#34; or WP-specific rules. If you add in what it refers to as &#34;non_wp_rules&#34;, then it doesn't actually apply them (so it still throws a 404).&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;The FIX!&#60;/strong&#62; on the code that I'm running, I have put the following &#60;strong&#62;WordPress&#60;/strong&#62; plugin in place to add rules appropriate for my bbPress installation:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function mbob_flush_rewrites() {
	global $wp_rewrite;
	$wp_rewrite-&#38;gt;flush_rules();
}
add_action(&#38;#39;init&#38;#39;, &#38;#39;mbob_flush_rewrites&#38;#39;);

function mbob_add_rewrites($wp_rewrite) {
	add_rewrite_rule(&#38;#39;forums/topic&#38;#39;, &#38;#39;forums/topic.php&#38;#39;);
	add_rewrite_rule(&#38;#39;forums/forum&#38;#39;, &#38;#39;forums/forum.php&#38;#39;);
	add_rewrite_rule(&#38;#39;forums&#38;#39;, &#38;#39;forums/index.php&#38;#39;);
	$wp_rewrite-&#38;gt;rules = array_merge($wp_rewrite-&#38;gt;non_wp_rules, $wp_rewrite-&#38;gt;rules);
}
add_action(&#38;#39;generate_rewrite_rules&#38;#39;, &#38;#39;mbob_add_rewrites&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;NOTE: I have removed a lot of my bbPress installation as part of my integration, so I didn't require any other rules to handle things like profile pages or tags - you probably will need to add them if you use those features.&#60;/p&#62;
&#60;p&#62;Hopefully this will help someone else and prevent you from beating your head against a wall like I almost did :)&#60;/p&#62;
&#60;p&#62;Thanks to sambauers for helping me out with this in #bbpress as well.&#60;/p&#62;
&#60;p&#62;Beau
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10532</link>
<pubDate>Tue, 28 Aug 2007 01:50:42 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">10532@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;My advice is don't try to change &#60;code&#62;bb_repermalink()&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Just to qualify myself, I rewrote &#60;code&#62;bb_repermalink()&#60;/code&#62; a while back to implement slug-based permalinks. It's a tricky beast, and the most complex part is the profile-page case.&#60;/p&#62;
&#60;p&#62;But if you must, then you should start by turning debugging on &#60;code&#62;$bb-&#38;gt;debug = 1&#60;/code&#62; in config.php should do it. Then when you hit your link you should get some readable debug info at the top of your page.&#60;/p&#62;
&#60;p&#62;The critical part of stopping the redirect is on line 1708 of bb-includes/functions.php, you have to make that condition happy to stop the redirect to it's preferred permalink location. That may involve simply modifying the &#60;code&#62;get_user_profile_link()&#60;/code&#62; and also the &#60;code&#62;get_profile_tab_link()&#60;/code&#62; functions, but I'm not 100% sure about that.
&#60;/p&#62;</description>
</item>
<item>
<title>fabianzaf on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10530</link>
<pubDate>Mon, 27 Aug 2007 23:40:37 +0000</pubDate>
<dc:creator>fabianzaf</dc:creator>
<guid isPermaLink="false">10530@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Awesome! I learnt something new ([^/]+) .. very cool.&#60;/p&#62;
&#60;p&#62;Ok the rewrite worked.&#60;/p&#62;
&#60;p&#62;Now just to figure out this repermalink... &#60;/p&#62;
&#60;p&#62;Any ideas guys? I'll go look around myself in the meantime ^_^
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10507</link>
<pubDate>Mon, 27 Aug 2007 00:38:58 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">10507@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Add this to your sites root directory .htaccess file.&#60;/p&#62;
&#60;p&#62;This assumes that your bbPress install is in a subdirectory of your sites root called &#34;forums&#34;.&#60;/p&#62;
&#60;p&#62;These rules need to be added before any WordPress rules.&#60;/p&#62;
&#60;p&#62;The rewrite will work, but bb_repermalink() will change the URL so that it appears as it normally would.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;IfModule mod_rewrite.c&#38;gt;
RewriteEngine On
RewriteBase /
RewriteRule ^users/([^/]+)/page/([0-9]+)/?$ /forums/profile.php?id=$1&#38;#38;page=$2 [L,QSA]
RewriteRule ^users/([^/]+)/([^/]+)/?$ /forums/profile.php?id=$1&#38;#38;tab=$2 [L,QSA]
RewriteRule ^users/([^/]+)/([^/]+)/page/([0-9]+)/?$ /forums/profile.php?id=$1&#38;#38;tab=$2&#38;#38;page=$3 [L,QSA]
RewriteRule ^users/([^/]+)/?$ /forums/profile.php?id=$1 [L,QSA]
&#38;lt;/IfModule&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>fabianzaf on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10506</link>
<pubDate>Mon, 27 Aug 2007 00:10:23 +0000</pubDate>
<dc:creator>fabianzaf</dc:creator>
<guid isPermaLink="false">10506@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;can I get a reply on this please
&#60;/p&#62;</description>
</item>
<item>
<title>fabianzaf on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10496</link>
<pubDate>Sun, 26 Aug 2007 12:26:40 +0000</pubDate>
<dc:creator>fabianzaf</dc:creator>
<guid isPermaLink="false">10496@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;I already edited the template-functions.php to &#60;/p&#62;
&#60;p&#62;		$r = bb_get_option('uri') . &#34;../user/&#34; . $user-&#38;gt;$column . ( 1 &#38;lt; $page ? &#34;/page/$page&#34; : '' );&#60;br /&#62;
	} else {&#60;br /&#62;
		$r = bb_get_option('uri') . &#34;profile.php?id=$user-&#38;gt;ID&#34; . ( 1 &#38;lt; $page ? &#34;&#38;#38;page=$page&#34; : '' );&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;I can access it from /user/username/ one level up (ie.root)&#60;/p&#62;
&#60;p&#62;So accessing the link isnt a problem. I just need it to be rewritten
&#60;/p&#62;</description>
</item>
<item>
<title>sambauers on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10489</link>
<pubDate>Sun, 26 Aug 2007 03:05:03 +0000</pubDate>
<dc:creator>sambauers</dc:creator>
<guid isPermaLink="false">10489@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Even if you got the Rewrite rules written correctly, the page wold not load due to the checks carried out that check the URL in the function repermalink().
&#60;/p&#62;</description>
</item>
<item>
<title>fabianzaf on "Rewriting up one level"</title>
<link>http://bbpress.org/forums/topic/rewriting-up-one-level#post-10486</link>
<pubDate>Sun, 26 Aug 2007 00:12:40 +0000</pubDate>
<dc:creator>fabianzaf</dc:creator>
<guid isPermaLink="false">10486@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Hey guys,&#60;/p&#62;
&#60;p&#62;I've been googling about this for a while now and cant seem to find a solution. If I want to do an SEO rewrite with Rewriterule that causes the file to be written up one level...&#60;/p&#62;
&#60;p&#62;(the equivalent of browser-side linking &#34;../&#34;) &#60;/p&#62;
&#60;p&#62;how would I do that?  for example, I have &#60;/p&#62;
&#60;p&#62;Rewriterule ^profile/  etc etc&#60;/p&#62;
&#60;p&#62;What do I do.. &#60;/p&#62;
&#60;p&#62;&#34;/profile/&#34;?&#60;br /&#62;
&#34;../profile/&#34;?&#60;br /&#62;
&#34;$/profile/&#34;?&#60;/p&#62;
&#60;p&#62;No idea really.. any thoughts on this would be great. I basically want it to go up one level and ignore my forums directory..&#60;/p&#62;
&#60;p&#62;so instead of /forums/profile/ its /profile/
&#60;/p&#62;</description>
</item>

</channel>
</rss>
