+ Reply to Thread
Results 1 to 8 of 8

Thread: Redirect removed inactived expired unidentified listings to other pages

  1. #1
    Senior Member
    Join Date
    Apr 2021
    Location
    USA
    Posts
    177

    Redirect removed inactived expired unidentified listings to other pages

    Hello guys,

    When user input a none-existing url like:
    https://classifieds.demoflynax.com/sdfs

    It shows the undefined page, where I can edit content, which is fine.

    But if users visit a none-existing listing url, whether the listing is removed, inactive, or expired, which is more common, for example:
    https://classifieds.demoflynax.com/p...st-48-642.html
    I added number "2" at the end of the url to replicate the none-existing listing

    The original url is without "2" at the end:
    https://classifieds.demoflynax.com/p...-st-48-64.html

    As you can see, it shows all sort of stuffs like: book now, average price, price history, nearby school, etc. Which not looking nice.
    So how do I redirect these none-existing listing url to the undefined page? Or better yet, another page I can edit content for none-existing listing, say I create a new page with page key "404_listing"

    Thank you for such a great script.

  2. #2
    Senior Member
    Join Date
    Apr 2021
    Location
    USA
    Posts
    177
    Bumping this up for new week

  3. #3
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    2,537
    Hello,

    Go to incudes > controllers > listing_details.inc.php

    replace:
    PHP Code:
    Only registered members can view the code
    PHP Code:
    Only registered members can view the code

  4. #4
    Senior Member
    Join Date
    Apr 2021
    Location
    USA
    Posts
    177
    Hi Rudi,

    Your code works thank you so much.
    One question, can we show the 404.html page but keep the url remain the same, work the same as none-existing page?

    For example user enter this none-existing listing url:
    https://classifieds.demoflynax.com/p...st-48-642.html

    It shows 404 page but the url remain the same:
    https://classifieds.demoflynax.com/p...st-48-642.html
    instead of
    https://classifieds.demoflynax.com/404.html

  5. #5
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    2,537
    Ok, instead:

    PHP Code:
    Only registered members can view the code
    use:
    PHP Code:
    Only registered members can view the code

  6. #6
    Senior Member
    Join Date
    Apr 2021
    Location
    USA
    Posts
    177
    Hi Rudi,

    The code does work and show the block of 404 page. But it seems to show only the content block, it does not show the whole page setting like other content boxes that were checked to show on 404 page. I'm building a 404 page with some content box showing tips and promotion. Can we show the whole page like regular 404 page?

  7. #7
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    2,537
    in this case, you should use the first solution

    otherwise, it will require customization to keep the listing url with the settings for 404 page

  8. #8
    Senior Member
    Join Date
    Apr 2021
    Location
    USA
    Posts
    177
    Ah I see, thank you for your help Rudi.

+ Reply to Thread