Help with custom rewrite rules

This topic contains 4 replies, has 3 voices, and was last updated by  Stiofan O’Connor 5 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #513826

    andreacagnone
    Free User
    Post count: 2

    I’m testing Geodirectory to know if it will be the right platform to migrate a big site using ACF, FacetWP and Frontend Publishing Pro

    I need to adapt these URL structures to match the ones currently used:

    1. /publish&listing_type=gd_place => /publish/listing

    I tried:

    
    
    add_rewrite_rule( 
        '^publish/listing/?$',
        'index.php?pagename=publish&listing_type=gd_place',
        'top'
    );

    But the parameter “listing_type=gd_place” is appended to the URL.

    2. /publish&pid=33 => /listing/33/edit

    I tried:

    
    
    add_rewrite_rule( 
        '^listing/([0-9]+)/edit/?$',
        'index.php?pagename=publish&pid=$matches[1]',
        'top'
    );

    But the form is not filled and the title is “Add %%pt_single%%”.

    I succeeded with this one: /index.php?post_type=gd_place&p=33&preview=true => /listing/33/preview

    
    
    add_rewrite_rule( 
        '^listing/([0-9]+)/preview/?$',
        'index.php?post_type=gd_place&p=$matches[1]&preview=true',
        'top'
    );

    I don’t mind editing core files and disabling automatic updates for the moment.

    PS: Is it possible to configure “Advanced Search Filters” addon to give priority to featured listings in the AJAX autocomplete functionality?

    Thanks!

    #513827

    Guust
    Moderator
    Post count: 29970

    I’ll get the developers to have a look at your questions.
    Thanks

    #514142

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi,

    I am a bit confused about what your current url structure is, could you give an example for a current listing?
    I would assume this can mostly just be done from settings.

    Thanks,

    Stiofan

    #514286

    andreacagnone
    Free User
    Post count: 2
    This reply has been marked as private.
    #514295

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Ah you are talking only about the add listing page..

    I don’t think there is currently a way to do that, the form is not using WP query args but just $_REQUEST params so unless u did a bit of trickery by setting those on the fly its not going to work.

    We also add package id to the url when you have the pricing manager added. Currently its not a simple task.

    Stiofan

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount