classic asp server.transfer error - asp-classic

I have a file failed.asp in folder abc. Now i want to redirect my user.asp page in folder xyz to page failed.asp when there is a error. When i have my failed.asp in same folder as my user.asp it does not give me error but if i use virtual path in server.transfer it is giving me error. How can i fix this.
Server.Transfer("failed.asp") --Works
Server.Transfer("abc/failed.asp") or Server.Transfer("../abc/failed.asp") --fails saying error when loading file
does not work what is the possible work around for this issue.

Server.Transfer("/abc/failed.asp") should work. Note that the root path starts with a forward slash.

Related

I get a 404 NOT FOUND error when trying to use a ngrok server

I'm currently using webstorm to program my webpage and when I open it through Google chrome and host it locally, the url the browser uses is
http://localhost:63342/assignment2/statichtmlpage-edit.html?_ijt=nqejipcmjnaun1b1416leu6a2i
When I open Terminal in order to host it on ngrok, I type in ./ngrok http 63342
and then a window opens with the ngrok url that I can use
but when I go to that URL (http://4038e733.ngrok.io) all I get is a 404 NOT FOUND error.
I'm not sure why this is happening, any help would be appreciated
Access your page with the full URL:
http://4038e733.ngrok.io/assignment2/statichtmlpage-edit.html?_ijt=nqejipcmjnaun1b1416leu6a2i
Add your path to web (.html) files after the http://4038e733.ngrok.io/ page.
You were hosting from the root directory http://localhost:63342/, but forgot to point to a file. So as expected, the error:
GET / 404 Not Found
Is saying there is no file at the root directory.
I'd imagine the fix for most users is to append /index.html to the end of their ngrok link:
http://ngrok.io/ ... /index.html

Symfony looks for app folder in wrong place

My Symfony 3.3 application is looking for app folder in wrong place.
I deployed Symfony 3.3 project to a subdomain (subdomain.domain.com). Subdomain folder location on server is: /home/USERNAME/public_html/PROJECTNAME
Subdomain document root is: /home/USERNAME/public_html/PROJECTNAME/web
This is normal Symfony folder structure, nothing changed. Why it doesn't look for app folder in correct place? What am I missing?
Error I get is:
request.CRITICAL: Uncaught PHP Exception Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: "The file "/home/USERNAME/public_html/app/config/routing.yml" does not exist." at /home/USERNAME/public_html/PROJECTNAME/var/cache/prod/classes.php line 3040 {"exception":"[object] (Symfony\\Component\\Config\\Exception\\FileLocatorFileNotFoundException(code: 0): The file \"/home/USERNAME/public_html/app/config/routing.yml\" does not exist. at /home/USERNAME/public_html/PROJECTNAME/var/cache/prod/classes.php:3040)"} []
EDIT:
I found out that composer.json was not in the correct folder. I posted that as an answer and accepted it.
composer.json file needs to be in the root folder of the app.
The error message gives you the clue, I don't know how you browse your site, but Symfony tries to find the file from your root folder, I guess you are trying to browse as a domain.if it is subdomain then URL should be like this SubDomainFolderName.DomainName
Or try to solve this using .htaccess
You should run bin/console cache:clear command after deploy.
And what about the content of getCacheDir method in AppKernel?
Should be:
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();

nginx 404 not found if URL contains "star"

Weird problem: If the URL contains the word "star", the result is a 404. It does only happen with this word.
Working:
http://example.com/some/another/url
Not working:
http://example.com/some/url/with/star
The virtual host config is not the problem as it appears on all server blocks, even in the default one.
The error does not appear in the access.log!
Anyone else with nginx 1.9.14 can reproduce this strange problem?
The reason was a copy & pasted line that should cache static files:
~*.(ogg|ogv|svg|tar…)
Since "star" is ending with tar (like the .tar archive) the rule fired because there is a missing backslash. It must be
location ~*\.(ogg|ogv|svg|svg|tar)
Thanks to nginx mailing group!

Server respond with a status 403 (forbidden)

I'm using asp.net MVC. I have hosted my website on appharbor. Everything is working fine on localhost. On live website I'm getting error.
Server responded with a status of 403 (Forbidden)
To solve this issue. I added <modules runAllManagedModulesForAllRequests="true" /> in web.config but it didn't work.
Another solution is I need to You need to change permissions on the folder bootstrap/css. To change permission I have to type command sudo chmod 0777. But I cannot figure out where to type this command.
So where I have to type this command or what is the alternative to tackle this 403 issue.
I know this is a little old, but I had the same problem now with jstree.
I don't know if you realized, but this behavior is given to you by the EnableOptimizations.
Basead on Denis Ivin answer here, you probably have a jstree folder inside Content/plugins and IIS, instead of giving you the jstree.css, is trying to list the folder and that is, by default, forbidden.
In my case I had to do the following for the plugin work as intended:
BundleConfig.cs
bundles.Add(new StyleBundle(
"~/Content/plugins/jstree/jstree")
.Include("~/Content/plugins/jstree/style.css"));
View.cshtml
#section css{
#Styles.Render("~/Content/plugins/jstree/jstree")
}

convert .WAR for auto deploy in karaf/servicemix

I've got very simple .WAR containing example servlet. I'm able to deploy it in servicemix using the following command:
osgi:install file:///home/seiho/apache-servicemix-4.4.2/deploy/TestServlet.war?Bundle-SymbolicName=TestServlet&Webapp-Context=/TestServlet
And then see it in my browser. But only with full path to a file, e.g.: localhost:8080/TestServlet/index.html or localhost:8080/TestServlet/TestServlet (my servlet is TestServlet class).
I'd like to launch the index.html page automatically after entering: localhost:8080/TestServlet
how to do it?
MORE IMPORTANT
I need a way to convert the .WAR file or servlet project (I've got the sources) so that new .WAR file can be auto-deployed by copying it to $SERVICEMIX_HOME/deploy directory.
I've tried editing the MANIFEST.MF file, but with no success. Probably I'm doing something wrong.
Thanks for any advice/help.
To be recognised as a wab, you need to add a context path header to your manifest:
Web-ContextPath: TestServlet
It's working now! I was doing my MANIFEST.MF according to this page: http://team.ops4j.org/wiki/display/ops4j/Pax+Web+Extender+-+War+-+OSGi-fy
The problem was that for some reason "Bundle-Version: 1.0" line was required as opposed to optional as stated on that page.
Honestly, just adding the Bundle-Version fix-it.
I knew it was something wrong with the MANIFEST.MF and after Holly Cummins' question I played with it a bit more. Thanks Holly.
I still can't do anything with the manual site launching (have to manually enter the index.html).
http://localhost:8080/TestServlet/ gives me this:
HTTP ERROR 404
Problem accessing /TestServlet/. Reason:
Not Found
Powered by Jetty://
http://localhost:8080/TestServlet/index.html gives me proper site.

Resources