Custom rewrite to page but no url substitution (4 posts)

  1. JayChandler
    Posted 4 years ago #


    I've got a strange problem. I have a page with follwing permalink
    /my-first-page ( id = 20 )

    Now i want to have another url /foo pointng to /my-first-page

    So i did some research on that and found following solution

    function flushRules(){
        global $wp_rewrite;
    function wp_insertMyRewriteRules($rules)
        $newrules = array();
        $newrules['^foo$'] = 'index.php?p=20';
        return $newrules + $rules;

    Thats just working but wp redirects to the url /my-first-page.
    I dont want wp to change my url rather i want to tell wp take this page id and show it under my custom url /foo

  2. David Gard
    Posted 4 years ago #

    So you are not in effect rewriting, you want to display the content from one page on anothe. You can do this with domains and it is know as Parking, but not sure if it is possible with single pages.

  3. JayChandler
    Posted 4 years ago #

    Yes i want to show content from /my-first-page under /foo. Isn't there any way to tell wp to do this. Can't be that problem ?

  4. Taylor Baybutt
    Posted 4 years ago #

    I want to do the same thing. In Buddypress I have a group that does not belong with the other groups. I want to give it its own url outside of the standard group permalink structure.

    Did you ever solve your problem?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.