• Hello. I am using a realter’s company plug in called Wasi (the plugin is in github, not in wordpress). I am having trouble with the plugin because wordpress does automatic redirects. I further explain my problem below.

    When I set up the plug in I am asked to create a blank page, which will be used by the plugin to display single for sale properties. Therefore, the the end user (web page visitor) can click on a link of any property on the property list and go to the single property page, where that property’s information is displayed.

    I have set up “prop” page to be the one to display single properties. Therefore when the user clicks on a property, he is taken to http://www.restrepoecheverri.com/prop/%propertyId% (lest say the property Id is 25531, so he would be taken to http://www.restrepoecheverri.com/prop/25531). Anyhow, when the GET request is send to http://www.restrepoecheverri.com/prop/25531, the server responds with a 301 redirect to http://www.restrepoecheverri.com/prop/. I think that this is caused by a WordPress automatic redirect. Therefore, I am trying to disable that WordPress automatic redirect, so I am able to use my plug in.

    I hope I have been clear enough and someone can help me with this.

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If this is the plugin https://github.com/wasico/wasi-connector I suggest asking at https://github.com/wasico/wasi-connector/issues

    Thread Starter juanchoarboleda1

    (@juanchoarboleda1)

    @sterndata Right. No one seems to answer there. I know it seems like a plug in problem, but all I want to do is disable automatic redirects in WordPress. Do you know how to do that?

    Moderator bcworkz

    (@bcworkz)

    I think redirects are caused by redirect_canonical(). It has a filter where you can alter its behavior. I don’t think that’s the right approach though. I think you should add a custom rewrite rule so WP properly handles the ID element in the URL
    https://developer.ww.wp.xz.cn/reference/functions/add_rewrite_rule/

    You also need to whitelist whatever query var you assign the property ID to through the “query_vars” filter. Finally, alter how the request handler code gets the ID. I assume this is some sort of template code for the “prop” page and it parses the request in some manner. After being properly rewritten, the value will be a query var in the global $wp_query object. You can use its get() method to get the query var value.

    N.B. – while there are superficial similarities, redirect and rewrite are two very different concepts. Mainly, one causes a new request be made, the other does not.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problems with automatic redirects’ is closed to new replies.