I create a Zend project. My images are in folder public/icons and they available when I run project using url http://localhost/zendproject/public/icons/image.png but when I use virtualhost http://zend.gameblog I can't get this image by url http://zendgameblog/icons/image.png.
Browser says "403 Forbidden" and I can't understand why. I also have public/captcha folder and any image from this location always available by url http://zend.gameblog/captcha/image.png.
I use: win7 x86, WAMP, zend framework 1.12, Zend Studio 9.0.4. Some of resources and folders I created manually not via Zend Studio.
Please help me and tell whether I will have such problems when I'll run my project at real server?
For all css, js and img on web site use baseUrl helper:
$this->baseUrl('/icons/image.png');
//or
$this->baseUrl('/css/css_file.css');
and for all links on web site use URL View Helper: $this->url(...)
Related
I used apidocjs to setup the documentation of my asp.net web api app. Everything works fine on my machine when I run my web api in visual studio but not on the server I deployed the app to.
I get a 404 error when I navigate to the index.html generated by apidocjs.
I think it's an issue with IIS.
I need suggestions on how to resolve this?
Ok. Found the problem kind of silly.
I did not include the ~ symbol as part of the path in my anchor tag.
Before I had
I added ~
<li>Docs</li>
<li>Docs</li>
and problem solved!!!
Update.
What I did earlier solved the problem on the deployment i did to my local IIS but not on my remote server.
I had move my static html file into the Content folder of my web-api, edited the link to look like this and the problem was resolved.
Docs
Got this from here. Ordinary html links in mvc razor
I have created a small site, on IIS express all is working fine. I have created on IIS new application and deployed the package to the folder. the server side is asp.net webapi. the bundle configuration is loading fine when i try to enter the home page, how ever the java script files which are referenced on the cshtml page cannot be found
<script src="~/Client/lib/require/require.js" data-main="../../Client/app/requireConfig"></script>
i am getting -
require.js
/Client/lib/require --> 404 cannot be found
and the bundle which works
viewingPanelDirective.js
/NGWeb/Client/app/appComponents/viewingPanel
how can I over come it?
I think i know what might be the cause, i had the same problem myself
in you visualstudio, the js file was running on a url like this
http://localhost:/client/lib/require/require.js
now you published it, and added it as an application to your default site, you would have given it an alias (e.g) "testsite"
meaning that in reality the file is hosted at
http://localhost/testsite/client/lib/require.js
but in reality your site is looking for it (because of the ~) at
http://localhost/client/lib etc etc
Edit in response to comment:
rather than removing the ~ (which you will need to navigate you back to the url root), i would rather just include your app name in the bundles virtual path, like this:
bundles.Add(new styleBundle("~/yourAppName/Content/css")) ....... etc
I also came across this post, I haven't tried it myself but it seems an interesting alternative to my method.
Fixing Relative CSS Paths when using .NET MVC 4 Bundling
I have hosted my asp .net mvc3 application in iis server 7. I had deployed my application under a virtual directory and url to my application is like www.abc.com/virtualdirname . Application works fine and Im able to navigate through pages. However , Im unable to view any images used in my application. I have stored my images in a folder public/images .
cshtml code for one of the image is as follows
img id="start" src="../../Public/images/start_button_start.png"
Im getting error message in place of images and path of image is www.abc.com/public/images instead of www.abc.com/virtualdirname/public/images .
In the app settings of my config file, I had defined virtual dir.
add key="virtualdir" value="/virtualdirname " /
Can anyone tell me why this problem happens and how can I get out of this?
Never hardcode urls in an ASP.NET MVC application. Always use url helpers:
<img src="#Url.Content("~/Public/images/start_button_start.png")" alt=""/>
Url helpers will take virtual directory into account.
I have a webform (using the ReportViewer) that is in an MVC application. It is outside the Views folder in a root level folder called Reports. The webform page works correctly when using VS2010 and the web server (Development Server, WebDev.WebServer, Cassini). When using IIS7.5 with an integrated Application Pool (also tried Classic and set the ISAPI restrictions to allow), it does not work. I have the modules..handlers item (Reserved-ReportViewerWebControl-axd) in web.config.
I am getting this page result: "The resource cannot be found." / Description: HTTP 404. The resource you are looking for ...
I hope someone has a fix for this.
Thanks in advance.
Try putting the file(s) under the content folder. That should remove any route problems.
I downloaded umbraco and used the web platform installer. Everything went though okay and it installed SQL Express 2008 and a new directory under the default website in IIS. However when I launch the website I'm redirected a dead page as below.
What do I do next?
Thanks!!
http://localhost/install/default.aspx?redir=true&url=/test1/default.aspx
Server Error in '/' Application.
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: /install/default.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
Umbraco must be installed as a root website, It cannot be installed as a sub directory or virtual directory under a website.
There are plans to support this in future although I'm not sure if a date has been given.
For more info see this post on our.umbraco.org
In the install wizard.
When you are asked to type in new web application and web site name, just leave them empty.
See this install guide
http://www.youtube.com/watch?v=wEeC4Bd-QZg
I just made a fresh and plain installing with the follow requisites and solved this problem:
Add and configured the website in IIS port 80
Pointed physical path to wwwroot
Configured the authentication
Unziped the Umbraco files in the root of server (wwwroot)
This solved but I don't exactly why.