locked
ASP Net FriendlyUrls appends existing url with new page url RRS feed

  • Question

  • User564110403 posted

    I have a Asp.Net windows form application. I have recently installed FriendlyUrls. As far as I navigate through page control the URL remains fine. But when I click on menu bar's link. The page's URL is added in front of old URL.

    e.g. if I am on page url: xyz.com/House/abc and then I click on menu's Society link (href="/Societies.aspx") then the url becomes xyz.com/house/abc/Societies

    Any help will be appreciated

    Saturday, May 8, 2021 8:06 AM

All replies

  • User-1545767719 posted

    Sohaib Toosy

    e.g. if I am on page url: xyz.com/House/abc and then I click on menu's Society link (href="/Societies.aspx") then the url becomes xyz.com/house/abc/Societies

    It seems that the FriendlyUrls is working properly. What is your issue?

    Edit:

    Sorry there is my oversight. Now I understand that you expect that clicking a link of href="/Societies.aspx" in the page http(s)://xyz.com/house/abc results in request to url of http(s)://xyz.com/Societies.aspx NOT http(s)://xyz.com/house/abc/Societies.aspx.

    Although I have tested in my environment i.e., Web Forms application generated by a template of Visual Studio 2019 in which the FriendlyUrls is enabled by default, I cannot reproduce your problem.

    In my environment, clicking a link of href="/Societies.aspx" results in the request of https://<hostname>/Societies.aspx. On first request browser request https://<hostname>/Societies.aspx as is and the web server returns HTTP 301 Moved Permanently with Location: /Societies in response header. Then browser requests https://<hostname>/Societies accordingly and shows the page as expected.

    After the first click browser always request https://<hostname>/Societies as the url is cached.

    I do not know why your case is different from the above. I guess that something not mentioned in your question above causing your problem.

    Saturday, May 8, 2021 11:06 PM
  • User564110403 posted

    Hello,

    Thanks or replying!!

    I'm working on a real estate website. URL is like localhost:12345/Societies/Blocks/Houses.

    Now, when I have reached Houses page and I click on Menu bar item (Societies) the expected URL is localhost:12345/Societies................Instead currently the URL becomes localhost:12345/Societies/Blocks/Societies...........

    I hope I've explained my problem in a better way

    Monday, May 17, 2021 7:08 AM
  • User-1545767719 posted

    Now, when I have reached Houses page and I click on Menu bar item (Societies) the expected URL is localhost:12345/Societies................Instead currently the URL becomes localhost:12345/Societies/Blocks/Societies...........

    You told us in your first post:

    > if I am on page url: xyz.com/House/abc and then I click on menu's Society link (href="/Societies.aspx") then the url becomes xyz.com/house/abc/Societies

    Now are you saying as follows?:

    if I am on page url: localhost:12345/Societies/Blocks/Houses and then I click on menu's Society link (href="/Societies.aspx") then the url becomes localhost:12345/Societies/Blocks/Societies

    Tuesday, May 18, 2021 3:13 AM