Can't Change Default Document

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anos atrás
I added an Index.aspx page to the root and set that as the default document, but the site keeps going back to default.aspx.

The site is on the live domain and I need to do more testing, so I added the index page as a splash page until the site is ready.  If I go with the store closed option, everything gets directed there and I can't continue to test it.

I would have held off on the domain transfer, but the only way I can complete the Google Checkout testing is to use an SSL protected domain and only the live domain has that.

Thanks for any help.
13 anos atrás
When you say you changed the default document, do you mean in IIS?

I think you are getting the run around from the URL Rewriting engine. Check out URLRewriting for details of how to change the redirects.

EDIT: Actually, I've just had a quick look at the config file. It doesn't do any obscure or unecessary rewrites of 'real' pages so it probably isn't that.

Depending on your IIS version, it might not store default doc info in the metabase, but in the web.config, so you might be updating the default in one, but it gets overwritten in the other, eg, if you are developing in Windows7 (IIS7 which changes the web.config) and running live in Win 2003 9that stores default doc in the metabase).

HTH.
13 anos atrás
I am using IIS 7 on Windows 2008, although, it is through a web-based control panel.  "Default.aspx" was at the bottom of the default documents list.  I removed the entry entirely and it is still redirect to default.aspx.

I will look into the link you posted.

Thanks.
13 anos atrás
I dug into the code starting from the Global page which includes a redirect for installation.  Where do I look for the default redirect - doing a global "find" in the project doesn't bring it up.
13 anos atrás
Digging more and I found there is a redirect located in BaseNopPage class that redirects to the store closed page if set.  Not finding any other redirects from there, though.
13 anos atrás
In IIS, there's a hierarchy in which page it chooses to open when a visitor accesses your domain.  If you look at the "Default Document" settings, make sure Index.aspx comes before Default.aspx in the list.

But, I don't think that's what you really need to do.  Try checking out this thread about how to access the site when the site is marked as closed.

Basically, you make a small change to that IF statement you saw in NopBasePage and as long as you're logged in as an administrator, you can access your site.  Everyone else gets the StoreClosed page.

Make sure you read my post further down in the thread, as it has the code that will also still let search engines in as well.

HTH,
Steve.
13 anos atrás
Thanks for the help.

I tried the code in the link and I still get redirected.
13 anos atrás
IF (you are compiling && reuploading the NC solution (including the /bin directory) after you make the change)
{
         I don't know what's wrong
}
ELSE
{
    1. You need NopCommerce with the source code.  Very important to have the source code
        if you want to modify the C# code of the site.

    2. After you make changes to ANY C# code, you need to "Build" the solution using Visual Studio.  Just changing
        the code in a .cs file will make no difference without rebuiding.

    3. If you're not editing and building on the host computer, you will need to FTP the whole NopCommerce store
        onto the host computer, overwriting any "newer" files.  If you only FTP files you yourself changed (in this
        case NopBasePage.cs) don't expect it to work.  Even if you recompiled.  Building the solution updates the
        DLL files located in NopCommerceStore/bin directory and they need to be updated on your site as well.
}
13 anos atrás
I do not have the full source.  I was modifying the /Controls/BaseNopPage.cs off the root.  Is there a different file I should be using in the full source?
13 anos atrás
Same file, but you must have full source version and rebuild the solution using Visual Studio after you make the change.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.