Is it possible to redirect from mydomain.com/path to otherdomain.com/path?
I want to use it to url shortener, so it have to keep path; redirect mydomain/1 to otherdomain/1
I do not think it's recurrent, I need to use a web server or change A record.
Related
In the setting of my App, I have set the site URL to be http://localhost/, in the app domain, I have indicated localhost.
Followed by in the Facebook Login Product, I have set Valid OAuth redirect URIs to be http://localhost.
but launch in my application, it gives me URL Blocked .... redirect failed because the redirect URI is not whitelisted in the app's Client OAuth Settings...
the redirect URI link is http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2Fao6eUeuGXQq.js%3Fversion%3D4
No matter what I change in the OAuth, the URI remains the same.
Anyone able to help?
Nope. Just localhost wont do. U need to put with port too. i.e http://localhost:3000/
There is NO url called http://localhost/ and If you put a port, it just talks about specific domain.
For example, if you put localhost which considered wild. For example what if you put www in your allowed url? It is considered illegal.
If you specify the port i.e http://localhost:3000/ then u just refereing to one domian at a time. And it is not wild nor illegal. Through this u are just allowing www.stackoverflow.com
I have old domain (bar.com), and new domain (foo.com). I want to redirect bar.com/path to foo.com/path by DNS only. Is it possible?
Other question:
Now I can make CNAME to redirect from *.bar.com to foo.com. But is possible if we can make redirect from *.bar.com/path to foo.com/path?
Thanks.
DNS is a complete different protocol to HTTP. It will not trigger any redirects nor does it know anything about URLs or paths.
How do I redirect http://olddomain.com/page to http://newdomain.com/page
The old domain is using namecheap's dns. Currently, I have setup a 301 URL redirect on olddomain.com and www.olddomain.com to www.newdomain.com. However, visiting olddomain.com/page takes me to www.newdomain.com instead of www.newdomain.com/page.
Is there a way to do it without using htaccess or php?
use webmaster tool. Thats is easy. We normaly use server side programming, ip redirect. But that is very easy and convenient.
I am wondering if there is a way to get facebook user profile image's real url in https.
Like I use https://graph.facebook.com/20926460/picture to get a the profile image,
It will redirect to http://profile.ak.fbcdn.net/hprofile-ak-snc4/41539_20926460_5421452_q.jpg.
Is there a way to get the "https" version of the second url? or is the url existing?
This might have changed in the docs since you last looked, I know everyone got excited about https after that snooping tool came out.
"If you need a picture to be returned over a secure connection, you can set the return_ssl_resources argument to 1: https://graph.facebook.com/xx_userid_xx/picture?return_ssl_resources=1."
Hopefully that won't redirect you.
Update 10 sept 2012
https://graph.facebook.com/20926460/picture now redirects to https urls.
You can just replace http by https in the target url but keep in mind that it is only temporary and may time out.
there is also no valid ssl certificate, but if you ignore that, the file will be served.
if you need a valid certified https url for pictures you need to set up a proxy script on your server that passes through the file.
edit:
as for your comment here is an example of what i meant by "proxy script".
you can put it on your server and request it with whatever protocl/scheme you like.
just like it was a local picture. you should probably validate the mime type. do some error handling and prevent injections etc. but just to give you ap icture:
<?
header("Content-Type: image/jpeg");
echo file_get_contents('https://graph.facebook.com/'.intval($_GET["id"]).'/picture');
fyi i put the int cast there to prevent injection hacking.
script is untested but should work as file_get_contents will follow redirects.
How can I turn domain.com into https://www.domain.com (the actual address)? Is there an easy API for this?
The purpose is to allow a user to enter a domain in preferences and allow my app to convert that into a fully qualified web URL like a web browser does when I type google.com it returns http://www.google.com (ish).
If typing your domain.com results in https://www.your domain.com then the server is redirecting. Here is a rule to follow:
Construct "https://domain the user typed". Connect to that, and follow any 301 (permanent) redirects until you get a 200 response. Save the URL you end up at as the permanent one.
If your connection failed, try again with http:// instead of https://.
Do not assume that the "proper" URL contains "www."; if it should, then the server will redirect.
What's so hard about putting "http://www." in front?
How does that require an API?
Are you asking about the string concatenation API?
Use the NSURL class. More specifically, use initWithScheme:host:path where scheme is "http", host is your string and path is empty.