YAFLogo

Coleen
  • Coleen
  • 89.2% (Honored)
  • YAF Commander Topic Starter
8 years ago
Well, one issue fixed and another pops up (sigh).

https://github.com/YAFNET/YAFNET/wiki/YAF.NET-Integration-in-to-an-existing-ASP.NET-Application  i.e., I did the upgrade and followed the instructions on how to integrate it with an existing website. It seemed to work (after a few snags with the database conection string/setup.) but now, my entire website is NOT working properly.

When you open the Home page for the website, it opens perfectly, and when you click on the link for the forums, they open perfectly. However, when you click on ANY other interior website link, it shows the page that is supposed to open when you hover over it, but it does NOT open anything. It's like there is a permanent redirect sending EVERYTHING back to the home page! Has ANYONE else received this kind of error and found it had to do with the UrlRewriter.config?

I opened the UrlRewriter.config file to take a look, and honestly, since I am NOT a C# programmer and have never used any rewrite code before, I have no idea where to even start as far as looking at that code! Technically, the UrlRewriter.config should NOT make every single page in the entire website re-direct ack to the home page, should it?

Any help would be greatly appreciated. TIA!

Sponsor

Coleen
  • Coleen
  • 89.2% (Honored)
  • YAF Commander Topic Starter
8 years ago
Just a quick question - could the UrlRewriter.config possibly NOT be required to be in the main root directory of the website, but only in the Forums directory?

Update - this error is occurring in my local host as well (sigh), so it obviously isn't related to the new hosting service. Also, I just tried moving the UrlRewriter.config file to be ONLY under the Forums directory, and I get the error:

Quote:

Configuration Error

Parser Error Message: Unable to open configSource file 'URLRewriter.config'.

So, obviously, the file HAS to be in the main website root. But why would it cause these errors? Argh! (Banging head!)

Coleen
  • Coleen
  • 89.2% (Honored)
  • YAF Commander Topic Starter
8 years ago
Here is some of the code in the URLRewrtie - Like I said, I do NOT program in C# so I don't know what all of it means, but I CAN see that it looks like the rewrite IS sending everything back to the MAIN root default:

Quote:

Since my page navigation is written using standard ~/root_default.aspx and ~/Root_pagename/Page.aspx i.e., my top navigation bar is written as:

Quote:

  • Heartbreaking Choice
  • Articles

  • Dealing
  • I can sort-of see where it is re-directing everything back to the main root defaul.aspx page. However, there is so much code there that I just don't understand, I am not sure where to start to fix it. Any help would greatly be appreciated. Thanks!

    Coleen
    • Coleen
    • 89.2% (Honored)
    • YAF Commander Topic Starter
    8 years ago
    Okay, unfortunately this has now become urgent! I absolutely HAVE to go live with the new hosting service tonight and I am still getting errors because of the URLRewrite.config file. I know it's related to the URLRewrite because I just remmed ALL code inside the URLRewerite.config out - and NOW the website will direct to the correct interior page! However, Now when I click on the ""Discussion Groups" link: http://localhost/aheartbreakingchoice/Forums/default.aspx it does open the main forums page, but when I click on ANY of the forums links with in the forums directory, I get a 404 error!
    Quote:

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /AHeartbreakingChoice/forums/yaf_topics12_World-View.aspx

    It doesn't matter which board I click on in the forum directory, it ALWAYS treturns a 404 error without the URLRewrite.config code!

    Please - does ANYONE know anything about the URLRewrite code? I honestly do NOT understand it so I can't edit it! Any help would really, REALLY be apprceiated. Thanks!

    tha_watcha
    • tha_watcha
    • 100% (Exalted)
    • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
    8 years ago
    Quote:

    I did the upgrade and followed the instructions on how to integrate it with an existing website. It seemed to work (after a few snags with the database conection string/setup.) but now, my entire website is NOT working properly.

    You need a special urlrewriter.config, which is included in the Sample Application

    https://github.com/YAFNET/YAF.SampleWebApplication/releases/download/v2.1.2/YAF.SampleWebApplication-v2.1.2-C.zip 

    If that is not working you can also completly disable the url rewritring as workaround via the app.config

    <add key="YAF.EnableURLRewriting" value="false" />
    Coleen
    • Coleen
    • 89.2% (Honored)
    • YAF Commander Topic Starter
    8 years ago
    https://github.com/YAFNET/YAFNET/wiki/Upgrade-%28from-Version-1.9.5.5-or-above%29  and also did the integration to the existing website. I had a ticket in to the help desk at my new hosting service (SmarterASP) and I reecived this message from them late last night:

    Quote:

    Dear Customer,

    It is asp.net url rewrite component, not IIS rewrite. I help you comment below code in UrlRewriter.config. Seems your site is working fine.

    Thank you.

    So I lucked out - I honestly was at my wits end because my hosting with Arvixe ended and I did NOT want to pay them for another month of crap service! I still have no idea exactly what the awesome tech help at SmarterASP did because I don't understand all the "^~/(.+)?\?(.+)?$" type code.

    The only thing that makes any sense in that code to me is the ~ because that is how you set the relative path in an asp.net link, so of course my code had a lot of ~/directory_name/file_name.aspx code in it.

    I wish I understood a little more about the URLRewriter so that I understood why remming it out fixed my website, but broke the forums! (sigh!)

    Oh well, all's well that ends well, so my great thanks to Ailen from SmarterASP.net who went beyond the call of duty and saved my bacon! :-d

    Zero2Cool
    8 years ago
    Originally Posted by: Coleen 

    I wish I understood a little more about the URLRewriter so that I understood why remming it out fixed my website, but broke the forums! (sigh!)

    The lack of my understanding of the Urlrewriter is the only thing holding me back from pushing my new Bootstrap style website/forum live. All of the Regex (not C# btw hah) kicks my booty! I haven't any idea how to debug it.

    Actually, that's a lie.

    http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx 

    That might help. Forgot all bout it til now.

    Coleen
    • Coleen
    • 89.2% (Honored)
    • YAF Commander Topic Starter
    8 years ago
    :cheesy: Thanks Zero, when I have time - I intend to go check out the code. Right now, I have 6 weeks of unhappy new members emails to sort through and try to get them set up in the newly hosted forums. At least NOW I CAN help them...before with Arvixe all I got was "It's an error in YOUR Code and will cost you $80 an hour for us to fix..." when in actuality it was a database corruption on THEIR end when they migrated their database servers! Oh well, as I said before, All's well that ends well. 🙂 Thanks for the link - I WILL check it out!
    Zero2Cool
    8 years ago
    Originally Posted by: Coleen 

    :cheesy: Thanks Zero, when I have time - I intend to go check out the code. Right now, I have 6 weeks of unhappy new members emails to sort through and try to get them set up in the newly hosted forums. At least NOW I CAN help them...before with Arvixe all I got was "It's an error in YOUR Code and will cost you $80 an hour for us to fix..." when in actuality it was a database corruption on THEIR end when they migrated their database servers! Oh well, as I said before, All's well that ends well. 🙂 Thanks for the link - I WILL check it out!

    I had similar issues with Arvixe. Tried them twice and both times whenever something unexpected happened, it was my fault. I even pointed out specifically HOW it was on their end and WHERE to look and they still pointed the finger at me. I understand folks hate being wrong, but that was crazy.

    I do not intend to checkout the url rewriter code. It gives me a headache.

    Coleen
    • Coleen
    • 89.2% (Honored)
    • YAF Commander Topic Starter
    8 years ago
    Quote:

    I do not intend to checkout the url rewriter code. It gives me a headache.

    OOOff! Me too! :roll: Still, I'd like to TRY to undertand (a little) what the heck the URLRewriter does...:wink: