Akamai has issue with ASPX post backs - asp.net

I'm using Akamai Edge Server to serve up all my web content except for html and aspx pages. The issue I am having is with a language switcher that does a post back to the same page and then based on the language does a response.redirect to the same page in the other language folder.
The steps that happen are:
go to page /en/default.aspx
select a different language such as fr.
The aspx code on that page calls a header user control which will then redirect to the proper language page
It fails on the postback to the control and I get an access denied on /en/default.aspx which is an akamai page not on my webserver.
If I access my dotnet server directly you'll see that the page will do a postback to itself /en/default.aspx then a response.redirect to /fr/default.aspx

Ok I figured it out that akamai edge server doesn't allow posts by default and you have to enable it. Im new to using akamai in this way didn't think it would deny such a common thing.

Related

Enable and Enforce SSL but allow independent ASPX page to use SSL

I have a DotNetNuke website set up with Enable SSL and Enforce SSL to allow us to have both insecure pages and secure pages such as the shopping cart.
However, I have an independent ASPX page (a PayPal IPN listener) that I want to be able to access through https://
At the moment, when a request is made to the IPN listener through SSL an HTML page containing javascript redirection code is served up to redirect to http://. Since PayPal's request doesn't respond to javascript redirects, the correct page is never requested.
Is it possible to enable SSL for this file?
EDIT: Added information about javascript redirect. Also, I have tried creating a virtual directory, but that does not allow me to use DNN application code in my aspx file.
What version of DNN? As technically I didn't think redirects should be impacting actual physical .aspx pages.
However, regardless you could put that file inside of a separate folder, then make it a virtual directory and that should block DNN's processing of the request.
You can do two simple things to overcome this:
Make sure your page is inherited from DotNetNuke.Framework.PageBase
In the aspx page, implement a PreRender method that will check request protocol and set response code to 301
Let me know if you need more help
-- Updated --
Locate at siteUrls.config in root and try adding following before </Rules></RewriterConfig>:
<RewriterRule>
<LookFor>.*PageName.aspx(.*)
<SendTo>~/PageName.aspx$1
</RewriterRule>

Why doesn't IIS7.5 show my default document with URL rewriting?

I'm using IIS7.5. I have a simple ASP.NET webforms site that uses basic URL rewriting in global.asax, intercepting requests for .aspx pages and passing them to various template pages.
For example, you can request http://www.mysite.com/default.aspx. In global.asax I first check if this exists as a "true" page. If it doesn't, I go off to the data store to get the details and redirect to template.aspx?page=default (or something similar).
This all works great. However, there's one issue. If I browse to http://www.mysite.com/default.aspx I get the page I expect. If I set the default document to default.aspx, either in the web.config or in IIS, then browse to http://www.mysite.com/ I get the error about directory browsing not being allowed.
Why is IIS ignoring the default document in this case? It appears to be because the file "default.aspx" doesn't exist. If this is the case, is there a workaround for the problem?
EDIT
To clarify, I don't have control over the IIS system and it's on really basic hosting, though I can request some changes, so I can't use any URL rewriting modules.
Workaround for you situation: Create Index.aspx as default document as physical file and redirect user to Default.aspx URL. So when user comes to mysite.com/ then index.aspx will kick in and force redirect to default.aspx which can then handle your template redirection logic.

How to get ScriptResource.axd? calls in HTTPS

My website is HTTPS and I use a redirect module to change any requests for a HTTP page into an HTTPS page. This works nicely using this...
http://www.codeproject.com/KB/aspnet/WebPageSecurity.aspx
However, the page also gets various script resources as part of the ASP.Net AJAX and Telerik controls e.g.
http://www.mywebsite.co.uk/ScriptResource.axd?d=RZJPznutyCmbbBAHSbKedj3kgUyiK7uBICOoB7IdFt8MWVJ-D-TxNWt-mdkCrv5HGSAToaV2udumFlE1EKBiow2&t=7dbf7a27
As the majority of my site uses HTTPS and then a few GET requests to form the page use HTTP IE8 does not like this at all and prompts the user to only show the content received via HTTPS. If the user does this then the ASP.Net AJAX javascript files are not loaded into the browser and chaos occurs!
Is there a way I can tell ASP.Net or IIS to serve all requests via ScriptResource.axd as HTTPS? I saw on a forum someone saying they had used a handler to do this but no example code was supplied.
Would be really greatful for a pointer in the right direction.
Thanks.

URL Redirects in ASP.NET

Ok, wierd problem I cant figure out. Hopefully someone where can. I have inherited a site that was developed with a very over-architected Content Management System. I am having problems now with the redirection functionality built into it.
This is on a dedicated Windows 2003 server running ASP.NET 3.5 sp 1. The redirects are stored in the database, and I have confirmed that the correct redirect is in place in the database. Finally, the file extension .html has been mapped in IIS to the ASP.NET ISAPI. And there is an HttpHandler created to redirect the .html requests. The default documents on the server, in order, are:
default.aspx
index.aspx
default.asp
index.asp
default.html
index.html
for this example, we have two redirects both pointing to the same content page. /example and /example.html
when requesting /example.html it correctly finds the appropriate redirect in the database and does its magic. Bueno. When requesting /example it gives a 404 page. Its not even the asp.net yellowish 404 generic error page. Its the standard vanilla IIS 404 response so it appears that asp.net is not intercepting these requests.
Let me know if any other information is requested and I will try to provide what I can. Thanks in advance for all the great recommendation I am sure will come from the community.
You should be able to map a wildcard extension to go through the ASP.Net ISAPI DLL is the solution.
Installing Wildcard Application Mappings (IIS 6.0) may also be useful.
Without rewriting the CMS, you can put a physical file in a new directory "/example". This will trigger ASP.NET to intercept the request, and hopefully load your page.
If you want to really hack it up you can change the IIS 404 page to be a .NET page in your application that can handle the original request and redirect to the page you really want.
Yes this is correct because /example is not pointing to any file, it is pointing to directory in the web server. Check that Default.aspx/ default.html or any other atleast one of them exists in your app.
If you are using ASP.Net MVC for REST then check your actions are properly written.

Custom URL Extensions/Routing Without IIS Access

I have a need to use extensionless URLs. I do not have access to IIS (6.0) so I cannot map requests to ASP.NET and handle with a HttpHandler/HttpModule. However, I can set a custom 404 page via web host control panel.
My current plan is to perform necessary logic in the custom 404 page, but it "feels wrong". Are there any recommendations that I am missing?
Edited: Added "Without IIS Access" to the title since someone thought this was a repeat question.
Without access to IIS, that would be your only option.
The 404 page really is your only option if you can't map the requests. I've seen several blog packages that do this to enable magic URLs like .../archive/YYYY/MM/DD and such - there's no such page, so it hits the 404 page and the 404 page does the redirection.

Resources