I have been building a site and it works fine locally but i get a 404 and it redirects to the generic error page when i upload it to FastHosts.
I contacted them and they say they think its a scripting error on my part.I dont even know where to look because ive not got any indication as to what could be the problem.
If any of you could help i would be very grateful.
The web.config looks like this ...
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OakmanDesign.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false" targetFramework="4.0">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
<pages theme="MainTheme" styleSheetTheme="MainTheme" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
</pages>
</system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
</configuration>
If you need any more information, let me know and i will happily provide it.
Is it the default home page or some other page that is causing the error? If you're having problems with the home page, check in IIS to see if Enable Default Content is selected and take a look at the documents listed for default content. Edit the list
if the name of your home page isn't included, and move it to the top of the list.
How did you deploy your ASP.NET site? Also it seems that you use ASP.NET 4.0, but FastHosts support ASP.NET 3.5 with their
shared Windows hosting plans.
It brings up the servererror.aspx when i add the error 500 message.
@SparTodd - Its on a remote host so i dont have direct access to their IIS (The site works fine locally)
@Hosting
Im pretty sure thats the problem is that im using 4. However when i try to change it to 3.5 i get all kinds of problems and the site stops working locally.
Ok i have got it partly solved. I changed the site to 3.5 and, due to the host not supporting HttpHandlers or modules in the web.config i removed them and the pages work.
However my next problem is that i built the site in VS 2010 and to create a database in that is to create an mdf file (or at least thats the only way i know how to do it) but my host doesnt support MDF files.
So i have to create a SQL database. I have created the MDF file but im not sure how to set up SQL server on my machine and more importantly how to import the data from the MDF file into a SQL database so i can put that onto my site.
dariune
Member
116 Points
106 Posts
404 error when uploaded
Sep 11, 2010 09:39 AM|LINK
Hi all
I have been building a site and it works fine locally but i get a 404 and it redirects to the generic error page when i upload it to FastHosts.
I contacted them and they say they think its a scripting error on my part.I dont even know where to look because ive not got any indication as to what could be the problem.
If any of you could help i would be very grateful.
The web.config looks like this ...
<?xml version="1.0"?> <!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config --> <configuration> <appSettings/> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OakmanDesign.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="false" targetFramework="4.0"> </compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows"/> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. --> <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> <pages theme="MainTheme" styleSheetTheme="MainTheme" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> </pages> </system.web> <!-- The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0. It is not necessary for previous version of IIS. --> </configuration>If you need any more information, let me know and i will happily provide it.
Thanks in advance
Dariune
sanjibsinha
Contributor
5014 Points
947 Posts
Re: 404 error when uploaded
Sep 11, 2010 12:56 PM|LINK
In web.config, customerrors part, you may try to get the mode on and see what happens:
<customErrors defaultRedirect="ErrorPage.aspx" mode="On"> <error statusCode="500" redirect="servererror.aspx" /> <error statusCode="404" redirect="filenotfound.aspx" /> <error statusCode="403" redirect="AccessDenied.aspx" /> </customErrors>404 error when uploaded
12reach: asp.net meets php
SparTodd
Participant
1350 Points
369 Posts
Re: 404 error when uploaded
Sep 11, 2010 01:04 PM|LINK
Is it the default home page or some other page that is causing the error? If you're having problems with the home page, check in IIS to see if Enable Default Content is selected and take a look at the documents listed for default content. Edit the list if the name of your home page isn't included, and move it to the top of the list.
HostingASPNe...
All-Star
15922 Points
2982 Posts
Re: 404 error when uploaded
Sep 11, 2010 01:46 PM|LINK
Hello,
How did you deploy your ASP.NET site? Also it seems that you use ASP.NET 4.0, but FastHosts support ASP.NET 3.5 with their shared Windows hosting plans.
Regards
Free ASP.NET Examples and source code.
dariune
Member
116 Points
106 Posts
Re: 404 error when uploaded
Sep 11, 2010 02:38 PM|LINK
It brings up the servererror.aspx when i add the error 500 message.
@SparTodd - Its on a remote host so i dont have direct access to their IIS (The site works fine locally)
@Hosting
Im pretty sure thats the problem is that im using 4. However when i try to change it to 3.5 i get all kinds of problems and the site stops working locally.
dariune
Member
116 Points
106 Posts
Re: 404 error when uploaded
Sep 11, 2010 10:59 PM|LINK
Hi all
Ok i have got it partly solved. I changed the site to 3.5 and, due to the host not supporting HttpHandlers or modules in the web.config i removed them and the pages work.
However my next problem is that i built the site in VS 2010 and to create a database in that is to create an mdf file (or at least thats the only way i know how to do it) but my host doesnt support MDF files.
So i have to create a SQL database. I have created the MDF file but im not sure how to set up SQL server on my machine and more importantly how to import the data from the MDF file into a SQL database so i can put that onto my site.
Is anyone able to help me with that?
Sorry for all the questions
kctt
Contributor
5130 Points
970 Posts
Re: 404 error when uploaded
Sep 13, 2010 01:13 AM|LINK
Open Management Studio, attach mdf file to a database.
If godaddy provide database restore tool in their control panel, backup your database (.bak file) and restore to hosting server.
You can also request the host to attach mdf file for you to a MSSQL database.
dariune
Member
116 Points
106 Posts
Re: 404 error when uploaded
Sep 13, 2010 09:11 AM|LINK
Hiya
Im actually using FastHosts (did i mention goDaddy because i am dealing with them with another site)
Thankyou all for your replies, i have managed to resolve the issue.
I apreciate the time people took to help me.
Dariune