WordPress.org

Forums

WordPress: Custom URL (4 posts)

  1. Muhammad Sajid
    Member
    Posted 4 years ago #

    At front end I fetches some links from mysql db table like:

    `<a href="http://localhost/my_site/detail/Link-1">Link 1</a>
    <br />
    <a href="http://localhost/my_site/detail/Link-2">Link 2</a>
    <br />
    <a href="http://localhost/my_site/detail/Link-3">Link 3</a>`

    and from admin side Setting -> Permalink I set http://localhost/sparcs/sample-post/
    and also create a page and named detail whose url is exactly http://localhost/my_site/detail/

    but when I click to any links WP says

    Apologies, but the page you requested could not be found. Perhaps
    searching will help.

    though I could use <a href="http://localhost/my_site/detail/3">Link 3</a> and it works fine & I could get url info using pathinfo($_SERVER['REQUEST_URI']);.

    Actually I create custom url in by db table and then show these url on my WP page leftbar and want if I click it wp show the page and I could be able to catch url info with pathinfo($_SERVER['REQUEST_URI']);

    I also used Custom Structure and set http://localhost/my_site/detail/url but not work.

  2. RichardWPG
    Member
    Posted 4 years ago #

  3. Muhammad Sajid
    Member
    Posted 4 years ago #

    I have read this in detailed & this does not cover my problem. Let me clear more. My links like Link 1, Link 2 are not like a regular WP posts I created them form my framework in mysql db table and fetch in left sidebar on href I used url field (fetches from db table) which is Link-1, Link-2 in this case and on detail page template I just fetch records from db table & show.

    Now if I use id field it works fine but when i replace id field with url field it says

    Apologies, but the page you requested could not be found. Perhaps
    searching will help.

    Now it is more clear

    I thing it is something from WP boot-striping

  4. Muhammad Sajid
    Member
    Posted 4 years ago #

    I think it might be solve using
    rewrite.php in

    wp-includes/rewrite.php

    but I don't know how & which function should be modify.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags