Subdomain masking - php

I want to know is it possible to mask our subdomain to another domain.
e.g:
this is may doamin : mydomain1.com so my subdomain is : sub.mydomain1.com
so how could i transfer mask sub.mydomain1.com with any other domain e.d facebook.com
so when someone open sub.mydomain1.com it show sub.mydomain1.com in address bar but show contects of facebook.
i don't want to do this with php because that will use all of my bandwidth because i want to stream videos so i can't also use iframe .

Normally you would do that with a HEADER-redirect. Mostly, you can set one in the admin-panel of your domain service provider.
If you do it with javascript, the url in the browser would change.

Related

Getting data from website without URL

I am working on a project which needs to extract data from website by parsing its html and getting the content out of title tag and meta description.I am able parsing that data from normal website, but in this matter the website is only can be access using IP address as the URL.Is it possible to be extract and what solution can be use?
A URL doesn't need a domain name, something like http://127.0.0.1/test.php is a valid url and all scraper should work with this correctly.
This requires the website to respond on requests to the ip-based url. Those on private servers or very big sites might do, sites from ordinary shared hosters usually don't as they host multiple sites with the same ip.

New Facebook Login with Codeigniter

i have implemented many code in my project.I am not able to identify the issue.
Which URL i need to use with this Everytime i get this error.
Given URL is not allowed by the Application configuration.: One or
more of the given URLs is not allowed by the App's settings. It must
match the Website URL or Canvas URL, or the domain must be a subdomain
of one of the App's domains.
put mu redirect and return URL string as - "http:// localhost / facebook/"
Same string i put in my FB App Account as "Site URL" : same line as above
I know this is repeated question but ...
Facebook login do not work locally, also you need to mention the URL in you facebook APP Setting
Go through following link for more details:
http://code.tutsplus.com/tutorials/how-to-authenticate-users-with-facebook-connect--net-12302
Canvas URL should be
http://localhost/facebook/
without spaces or otherwise.
In App Domains you should also add
localhost
Use IP Address i.e. 127.0.0.1 instead of localhost
and one more thing you should check .i.e you need to define redirect_url along with your config and which is must be same as site_url you define in your facebook app
Checkout http://subhra.me/using-facebook-php-sdk-3-codeigniter-2-1/
This a very simple tutorial.

Domain Masking For Multi Subdomains in a SaaS App

I am setting up a SaaS application written in PHP. Now every user gets a subdomain.appname.com where subdomain is user's choice. So there can be subdomain1.appname.com, subdomain2.appname.com and so on.
I have setup the CNAME entry too as a user's domain so that subdomain1.customerdomain.com points to subdomain1.appname.com and when I try subdomain1.customerdomain.com it perfectly loads the subdomain1.appname.com with subdomain1.customerdomain.com in the address bar.
As soon as I hit any link in the app, the domain in the address bar changes to subdomain1.appname.com which is obvious because there is no htaccess rule yet. And that's where I need help..I suck at htaccess, so what should be the htaccess file like to handle domain masking and keeping user's domain in the address bar all the time.
No, the problem here is not .htaccess, the problem are the links.
The application must output all links using the hostname actually used in the URL. It must not use a fixed application URL, but determine it dynamically.

Facebook Login with multiple completely different domains

I am building a network of sites, all running the same underlying code (different data and themes - similar to StackExchange in a way). Each site has its own distinct domain name. I would like to enable Facebook login for all sites, using ideally only 1 "facebook app".
Facebook asks you to provide a list of "App Domains". My first problem is that I may potentially have many - read hundreds of websites in the network, so doing this manually doesn't seem great. The second issue is that it seems this feature only works on similar domain names (like myapp.com and myapp.co.uk).
Trying to add domain names gives me the following error:
[newdomain].com must be derived from one of: Site URL, Mobile Site
URL, Canvas URL, Secure Canvas URL, Page Tab URL or Secure Page Tab
URL.
I'm thinking maybe to use one domain dedicated to the facebook login. But then how would I redirect and log the user to the correct site?
I'm just not sure how to approach the whole problem.
Some data about my tools:
PHP & MySQL
Yii
HybridAuth
I also had same problem.So i just came out with redirecting user to my root domain & when user is authenticated redirect to request domain's main page with encrypted data & a little user's info(if you wish you can provide user info by api access). Encryption should be strong enough & should depend on date time....to make hard for recognizing...& then store data in sessions ,from main page redirecting user to requested page.
In whole process you will have to preserve the url from which user is redirected.

Building a REST API to publish a website to users domain

Use Case: I am working on an application where user can build his own html template and publish it to his domain by selecting one. He can use different components to do this.
Issue: I want to transfer the pages build by the user from my domain to his created domain. Something similar to what is done here. Now currently in the prototye, what I do is write the content to a file (a .html file using ajax request) then make an FTP connection to the users domain (possible beacuse domains are created dynamically by the application) and transfer the files to his domain.
This, I believe, cannot be the right way and I would like to build it around a REST service which would make it flexible and also secure.
Research: I went through the web and found some website handle this very well (like the one mentioned above) and believe they have built it as a service. Am I on the ?
I would like suggestions and the possibilities so I can move forward. I am using PHP on the server side and javascript on the client side.
I can see some possible features to add safety to your services :
Check the source IP from the request, and only allow your servers to make the REST calls.
add header('Access-Control-Allow-Origin: *'); with the list of the possible domains to make the calls, instead of the *.
add security tokens related to the caller machine IP address, that would work as a password for the machine.
send all the data using post instead of get.
To update the page, I would go this way :
keep the data in the database, on server 1
add a page that reads from the database the content of the page based on a domain parameter
on the domain page call server 1 with the domain parameter to get the contents

Categories