HTML META REDIRECT to old URL - caching

I just wanted to redirect from e.g. www.example.com/example to another URL.
I tested it with this index.html in example.com/example and it looked like this:
<html>
<head>
<title>TITLE</title>
<meta http-equiv="refresh" content="0; url=http://sample.org/sample">
</head>
Goto to URL http://sample.org/sample
manually.
</html>
It worked just fine. Then I changed the "http://sample.org/sample" URL to the URL I wanted to redirect to.
But there occures the problem. It still redirects the example.com/example to sample.org/sample and not the actual one.
I tried to clear the cash, history and cookies in Firefox and did a DNS-Flush with "ipconfig /flushdns".
I also deleted the folder example and created it new. But nothing helps.
When I'm accessing example.com/example/index.html it redirects to the URL I want to. But if I'm accessing example.com/example it still redirects to the unwanted sample.org/sample.
Any glues how to fix this?

I just figured out that the proxy in our company also does have a cache. I tested it outside of our company network and it worked just fine. So this is fixed ;)

Related

mod_rewrite external links issue (wordpress)

i have a redirect.php and a link and it doesn't work in WORDPRESS.
i expect when i click the "hello" link on my site, it goes to redirect.php, the user sees the spinner for 5 secs, and the users exits my site to hello.com
it looks like there is something wrong with mod_rewrite i'm unable to solve
i'd really appreciate a very detailed answers. i am very junior
this what i have.
1.- I have an external link in my homepage:
Hello
2.- In redirect.php, i have:
<html>
<head>
...
<meta http-equiv="refresh" content="5;url=<?php echo $_GET['link'];?>" />
...
</head>
<body>
<h1>You are leaving my site!</h1>
<img src="/images/spinner.gif" alt="spinner" />
</body>
</html>
The link <a href="http://redirect.php?... is incorrect. This should most likely be <a href="/redirect.php?... or any subdirectory on your server.
You should also include the protocol in your link parameter or prepend it in your meta tag. Also make sure to HTML encode the link in your meta tag and to properly URL encode the domain name in your link parameter.
So, change the link to:
Hello
if you have the redirect.php file in the root of your website. And change the meta tag to:
<meta http-equiv="refresh" content="5;url=<?php echo htmlentities($_GET['link'], ENT_QUOTES,);?>" />
And you might want to do some validation on the validity of the link parameter and you possibly also want to check the referrer URL ($_SERVER('HTTP_REFERER')) to make sure you only perform redirects for links from your own website (i.e. don't create an open redirect vulnerability).

ColdFusion application caches switch statement

I'm not familiar with caching in coldfusion, but it seems it's doing somethnig it's not supposed to in my website.
I have only one index page, that uses a big switch statement to determin what cfm files to include, to build my website's pages. No everything works fine, I even have a default case that refers back to the homepage when trying to access a non-existing page.
When I create a new page and try to go to it but in the meantime forgetting I need to add a cfcase first, goes to the defaultcase. If I then create the needed cfcase, it should work, but it has cached the redirect of the last time, the path it followed in the switch/case, so I still get the defaultcase. Even if remove the defaulcase from the code, it still goes there.
Is there anyway to tell coldfusion to stop caching my switch/case. The rest of the content may be chached, no problem, just not the path of the switch/case..
edit 1
Here's my code:
<html>
<head>
</head>
<body>
<cfswitch expression="#attributes.fuseaction#">
<cfcase value="home">
<cfinclude template="dsp_home.cfm" />
</cfcase>
<cfcase value="admin">
<cfinclude template="admin/dsp_login.cfm" />
</cfcase>
<cfdefaultcase>
<cf_goto fuseaction="home">
</cfdefaultcase>
</cfswitch>
</body>
</html>
attributes.fuseaction is a variable that is stored in the url of the requested page, like so: http://www.domain.com/index.cfm/fuseaction/#switch/case-variable#.
cf_goto is a custom tag that gives a 301 code and redirects to the specified page where that variable is home.
When I do what I described above, the headers still give me the 301 error code and de redirect to the default case page. So I'm at a loss what it is that's being cached here.
CF doesn't cache switch/case logic, so it's a red herring to be looking at that to solve whatever your problem actually is.
Do you - by any chance - have "Trusted Cache" switched on in CFAdmin? If so, you'll need to clear it so your CFM files recompile when they're requested, and your changes will take effect.
Failing that: we need to see your code, as per Duncan's suggestion.

Issue with Open Graph Debugger not seeing og:url correctly

I'm having an issue trying to verify my Open Graph object. The debugger says:
"There was an error in fetching the object at URL 'http://digiarmy.com/ogItem.php?id=3', or one of the the URLs specified via a redirect or the 'og:url' property including one of http://www.digiarmy.com/ogItem.php?id=3."
Yet in the section titled Raw Open Graph Document Information I see this:
<meta property="og:url" content="http://www.digiarmy.com/ogItem.php?id=3" />
Am I just missing something or is something not working? I did the Cookie Recipe tutorial and it works fine.
Remove the www from the url meta tag since you are redirecting www to non-www.
try adding
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
above the head of your doc. If this does not solve the issue, you may wanna remove any redirects you have in DNS for that page.

Facebook button for Ajax Pages, how to implement and verify that it works

I wanted to know how can I use Facebook Like button on my Ajax web application, that will capture changes in the Open Graph tags for both the og:title and the og:url. I already created a Facebook app and got an API ID.
What I want to know is the code that I need to put on my website in order for Facebook to capture the changes that I've made to the meta tags which contains that title and url information (ie. og:title, og:url).
I followed the instructions on Facebook without success. Furthermore, I want to know how can I locally test the Like button to see that it grabs the data from the Open Graph tags properly.
Also worth mentioning that I've a JQuery code that automatically alters the Open Graph meta tags to include the relevant information for the current Ajax changed page.
Thanks.
You will need to have a separate url for each different page that you want to allow people to like. I would recommend actually pointing the like button to the physical pages you're trying to return via the og:url tag. To refresh the data that Facebook stores about a given url, pass that url into the linter at http://developers.facebook.com/tools/lint.
i created a rotator file for facebook share on my dynamic ajax website.
rotator.asp code sample:
<html>
<% lang=request("lang")
id=request("id")
..some sql to get data...
ogTitle=....
ogImage=....
originalUrl=....
%>
<head>
<meta property="og:title" content="<%=ogTitle%>" />
<meta property="og:image" content="<%=ogImage%>" />
.....
......
<meta http-equiv="refresh" content="0; url=<%=origialUrl%>" />
//dont use redirect.. facebook dont allow 302...
</head>
<body></body>
</html>
for example xxx.com/#!/en/153 page will share xxx.com/rotator.asp?lang=en&id=153

How can I redirect my domain to a different page or directory?

Please suggest a method other than use of .htaccess..
It really is homework-due-day today.
Theres httpd.conf (apache)
http://httpd.apache.org/docs/1.3/configuring.html
Or, forcing an "Error 301 - redirect".
Or, you could put a meta-refresh in your webpage redirecting to the new webpage.
e.g.
<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com">
Or you could use javascript to force the redirect.
<script type="text/javascript">
window.location = "http://www.google.com/"
</script>
Then there are things like Reverse Proxy that could do what you wanted.
Depending on the technology and/or your access to the web server there are various options. In addition to the above you could use a server side code redirect e.g. in ASP.Net
Response.Redirect("http://www.google.co.uk")
I'm sure there are PHP and various other code alternatives to perform the same action.
You can do a client side redirect using an index.html and a META Refresh tag.
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://www.mysite.com/MyDir/MyPage.html" />
</head>
</html>
http://en.wikipedia.org/wiki/Meta_refresh
Implementation-agnostic:
The following status codes can be used in a web server response:
301 Moved Permanently
302 Found
If you don't have access to a decent web server, try the Javascript
or Meta-Tag methods above.
Bonus: another implementation-specific advice, using Hunchentoot:
(redirect "http://otherhost/otherpath")

Resources