[wp-hackers] Custom Permalinks - how to?

Niels Hackius niels at hackius.de
Tue Jun 13 19:31:53 GMT 2006


Sam, Brian, fellow Hackers,
thank you very much for the quick answers - I realize there has talk
about a problem similar to this: However I am more going in the
direction that besides passing on a variable I would like to go to a
specific page too:

I already have a template-redirection-Function that looks like this:

	function SingaporeGetTemplate($vars)
	{	
		if($this->SingaporeIsPage()){
			if (file_exists(TEMPLATEPATH .  '/singapore_page.php')) {
				include(TEMPLATEPATH.'/singapore_page.php');
				exit;
			}
			else {
				add_filter("the_content", array($this,"SingaporeTheContentInclude"));
			}
		}
	}

I also implemented Sams suggestions, but that doesn't make any
difference right now.

Is it even possible to have redirect target like this:
"index.php?page_id=67". Because on a normal page redirect the id isn't
shown. It looks more like this:

   [index.php/fotos/([^/]+)/?$] => index.php?attachment=$matches[1]
    [index.php/fotos/([^/]+)/trackback/?$] =>
index.php?attachment=$matches[1]&tb=1
    [index.php/fotos/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] =>
index.php?attachment=$matches[1]&feed=$matches[2]
    [index.php/fotos/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] =>
index.php?attachment=$matches[1]&feed=$matches[2]
    [index.php/fotos/attachment/([^/]+)/?$] => index.php?attachment=$matches[1]
    [index.php/fotos/attachment/([^/]+)/trackback/?$] =>
index.php?attachment=$matches[1]&tb=1
    [index.php/fotos/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$]
=> index.php?attachment=$matches[1]&feed=$matches[2]
    [index.php/fotos/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$]
=> index.php?attachment=$matches[1]&feed=$matches[2]

How does Wordpress know which page to flip open right there?

Thank you so much for helping out,
Niels Hackius

2006/6/13, Sam Angove <sam at rephrase.net>:
> On 6/14/06, Niels Hackius <niels at hackius.de> wrote:
> >
> > What it outputs in the rewrite-rule-Array is this:
> > [index.php/gallery/(.+)/?$] => index.php?page_id=67&gallery=$matches[1]
> >
>
> That looks like the right rule to me. Does WordPress know about the
> "gallery" query var? Something like:
>
> function singaporeAddQueryVar($vars) {
>         $vars[] = 'gallery';
>         return $vars;
> }
> add_filter('query_vars', 'singaporeAddQueryVar');
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


-- 
call +49 (0)175 9575703
home +49 (0)351 2506142
niels at hackius.de


More information about the wp-hackers mailing list