Friendly URLs - caching wrong route - asp.net-mvc-routing

I am using ASP.NET Friendly URLs with a C# asp.net 4.5.1 website on a Windows 2012 Server with IIS implementation.
(this simply and automatically converts aspx pages into nice URLs - eg mydomain.com/mypage.aspx - into mydomain.com/mypage). If a page isn't found the site then falls back to looking for routes. My RouteConfig.cs looks like this...
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
// Firstly Friendly URL's are enabled
routes.EnableFriendlyUrls(settings);
routes.Ignore("{resource}.axd/{*pathInfo}");
// Now a regular root is looked for
routes.MapPageRoute("route1", "{myroute}/{myroutename}", "~/routepage.aspx");
I tried accessing mydomain/testpage when testpage.aspx DIDNT exist. It routed to mydomain.com/thispage.
I then created testpage.aspx - but now if I try and access mydomain/testpage it still goes to the old route like the page doesn't exist. I've tried restarting the website in IIS, reuploading the RouteConfig.cs file - it still routes wrong.
I've tested on multiple browsers (Chrome & FF on Mac) - all fail. I've tried typing mydomain/testpage.aspx - still routes wrong.
I created a new subdomain for testing - and the page works fine in that.
It's like it's cached somewhere. How can I 'force a refresh' - ie get the newly uploaded page to work?
thanks

Ensure you are uploading the bin folder - this fixed it.

Related

Redirect to undefined after login to back office in prestashop

I have a problem with prestashop (version: 1.4.4.1) after some problems with domains and database, all configurations connected with them were changed to correct ones (PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL in ps_configuration table are set correctly and the cache and compile folders were cleared and of course database config in settings.inc.php) and the Front Office works fine but after login to Back Office the Back Office's page shows for a second and after that the page is redirect to 404 page - I've noticed that address to which the redirect is set is: admindir/undefined and also I found the source of this redirect: redirect function in js/ajax.js (line 131) (but the real source unfortunately is unknown). Strange thing is that when I moved the system to localhost it works fine.
What do you think, what is the problem?

facebook app dev; auto-gen'd heroku prod host; local dev virtual host; tunnlr; FB login-issue

I'm developing my first Facebook app using custom Open Graph actions and objects, and I'm trying to avoid needing to deploy after each code-change (in this case, to my automatically setup heroku-account).
The problem started while I was getting set up to test the publishing of my first custom action. I was trying to set up everything in terms of the dev-version of my facebook-app, except for my "object" page, which, as I understand it, needs to be publicly accessible (to scrape the OG meta-tags).
I made a test-page for my custom object, copied the auto-generated set of OG meta-tags into it (citing the dev-version of my app_id, but with the public URL of the prod-version of my app for og:url) Then, I used the facebook "lint" tool on that test-page, and it, I guess not surprisingly, complained about that public domain being invalid for the relevant app (the dev-version of my facebook app).
Object Base Domain Not Allowed: Object at URL
'http://foo.herokuapp.com/testEventPage.php' of type 'foo:product' is
invalid because the domain 'foo.herokuapp.com' is not allowed
for the specified application id '(the app_id)'.
Then, I learned about using Tunnlr to port-forward from a public site to my local env and proceeded to get that set up.
I'm using MAMP with a virtual host config as follows:
<VirtualHost *:8888>
DocumentRoot "(the relevant docroot)"
ServerName foo.local
SetEnv FACEBOOK_APP_ID (my dev FB app-id)
SetEnv FACEBOOK_SECRET (my dev FB secret)
</VirtualHost>
And I'm using tunnlr, with the cmdln for it pointing to port 8888.
Using the public URL provided by Tunnlr, I am successful in accessing my local pages, but, when I try to use the "Login" button on the page that came with the example PHP-code from Facebook, the login-dialog pops up but immediately disappears, though when accessing it directly locally it works fine.
Could this be cookie-related? Something to do with port-forwarding and cookies?
Is there a better way to develop Facebook apps, in particular ones involving custom Open Graph actions and objects?
EDIT: like the doctor said, if it hurts when you move your arm like that, don't move your arm like that! In other words, access the Tunnlr-URL via the Facebook-Canvas URL, which POSTs the embedding page's current login to your own page; and, as a user (optionally a test-user), don't use the example-code's login-button; instead use the embedding page's login-feature. So, I've answered my own question.

GWT - gwt.codesvr= tag being removed

I'm working on a GWT application.
I wish to debug the client side Java code.
I start up the application from Eclipse in debug mode.
The app starts in the browser with the gwt.codesvr= set correctly.
I can debug at this stage.
The app then redirects to the a different jsp page.
The gwt.codesvr= parameter in the URL is dropped.
The app uses History.newItem("xx") quite a bit (as described in http://code.google.com/webtoolkit/articles/mvp-architecture.html#history)
The problem is that I can't now debug the client side code.. as the
gwt.codesvr= parameter has been dropped from the URL.
When I attempt to add it back in, the app History handling code runs,
and the parametes is immediately dropped again.
I checked this on another PC and the same behaviour occurs.
I checked in Chrome and IE8 and the same..
What is the solution ?
Thanks A million,
Fergal.
History.newItem() keeps the query string intact (in this case, the ?gwt.codesvr=... part), so these calls shouldn't be the problem here.
You say, that the app redirects to a different jsp page. Find out, how it does that - it may use something like Window.Location.replace(newURL). Make sure, that newURL contains the gwt.codesvr=... part in its query string.
If the server performs a redirect itself (e.g. if it redirects after a POST request), then make sure, that the server adds the query string in the redirect URL. (You will probably have to submit your codeserver URL with the POST parameters in this case - because this is a client-side concept, and the server cannot simply guess it.)

Codeigniter Facebook app POST method AND query_string

I have a toy facebook app I'm playing with so I can understand how it all works. It's fine if you go the the app like this: http://apps.facebook.com/pushup-challenge/ (and connect it). But if you then go to it from your facebook page, FB uses the URL http://apps.facebook.com/pushup-challenge/?ref=bookmarks.
In my log file, I see that FB is POSTing the data and including the /?ref=bookmarks to it's call to my codeigniter system. This is causing it to either say "invalid URI parameters" or give me a 404, depending on if I've edited the system/core/URI.php file to add rawurlencode() to a particular call.
I've tried using mod_rewrite to get rid of the query_string, too, but since it's POSTing, it doesn't appear to be working (though I'm not exactly sure why).
Has anyone else run into this? How did you fix it?
Thanks in advance,
Hans
try $config['uri_protocol'] = “PATH_INFO”; and set enable_query_strings = TRUE
or
set
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?=';
in config.php
Because it isn't calling your file by name (just ?ref=bookmarks) the server runs thru the standard default files: index.htm, index.html, index.asp. Because you need to accept a POST, you need a server that allows POSTs to htm & html if you choose to use those. Index.asp will accept POSTs on most servers, and that works for me.
SOLUTION: Add a file (index.asp), that calls the real app that you named in the App settings.

Debug gwt inside facebook iframe

I'm trying to debug my gwt 2.0 apllication that runs inside facebook iframe.
When i use 'http://127.0.0.1:8888/index.html?gwt.codesvr=127.0.0.1:9997' as "Canvas Callback URL" my app doesn't loading, but when i compile it and use 'http://127.0.0.1:8888' it works perfectly.
There is a cross site scripting issue with using the GWT debugger within the facebook iframe.
I logged this as issue #4468
http://code.google.com/p/google-web-toolkit/issues/detail?id=4468
Within that ticket, I specified the workaround is to edit the hosted.html file thusly:
hosted.html
gwtOnLoad = function(errFn, modName, modBase){
....
var topWin = window.top;
var url = topWin.location.href;
...
Workaround if you have one:
var topWin = window;
var url = topWin.location.href;
I have a similar issue for deployment mode. Basically I want my GWT to be managed from a single entry point deployment and be able to run it as widget on 3'rd party websites, without them have to download my application into their host, only using the selector script as reference to my GWT app.
There is a problem doing that due to SOP limitation of current bootstrap process that uses an "iframe" to load the compiled script asynchronously.
I created a workaround procedure for that, let GWT app be installed using 'script' instead of 'iframe'. This makes my GWT available for 3'rd party websites, and let me maintain a single entry point of deployment.
The following article describe my workaround procedure:
Make GWT Widget Avialble For 3'rd party websites
127.0.0.1 is a reserved IP address that always resolves to localhost. So when you enter that as a Facebook canvas URL, Facebook tries to access it's own servers. A request never comes to your computer, which is where the application is actually hosted. Of course, when you access it at 127.0.0.1, it works fine, because your localhost is your own machine.
You need to figure out your external IP address, and enter that as the Canvas Callback URL. You can check your router settings, or go to something like http://www.whatismyip.com/. Once you have it, try accessing your application using it directly instead of 127.0.0.1. You might have to change your router or firewall to allow port 8888 through. Once you have it working, enter it as your Canvas Callback URL in your Facebook application settings.