Change WordPress permalinks after a domain forwarding - php

So here is the situation:
I have a domain, a.com registered on host1.com
I have a domain, b.com registered on host2.com and a Wordpress website on this domain, hosted in the same hosting(host2.com).
I forwarded a.com domain to b.com using the domain forwarding service of host1.com.
Now when I type a.com in my URL bar in my browser, I see the wordpress website from host2.com but because I masked a.com I still see a.com in my URL bar.
So far so good and this is exactly what I wanted to do.
Here begins the problem:
All internal links in my wordpress website are still linked to b.com.
For example if I click a post, the link is b.com/posts?id=4 and the URL bar shows just a.com even when I go to that specific post and no matter to what page or post I click, the URL bar shows a.com.
What I want to achieve is to show a.com/posts?id=2 or any other url pattern but with the a.com as prefix.
I know it's a little bad explained but I really need your help and would be happy to clarify any questions you had to fix this problem.
Thanks

Related

Why www.mydomaim.com not working for wordpress?

I have wordpress website on openshift cloud. URL mydomain.rhcloud.com or http://mydomain.rhcloud.com work fine in browser.But when site access through www.mydomain.rhcloud.com URL "server is not find" shown.why this happen?
There is no record created for www.mydomain.rhcloud.com, only app-domain.rhcloud.com. if you want to add your OWN domain name like www.example.com, you need to purchase it, then add an alias to your app-domain.rhcloud.com, and setup your dns for www.example.com to point to it using a CNAME record.
I guess that the original domain name here is "rhcloud.com" and that "mydomain" is just a subdomain. In this case, "www.mydomain" is a different subdomain and it cannot be redirected to "mydomain.rhcloud.com".
To make this work, you should grant "www.mydomain" subdomain and either put your site there or make it redirect automatically to "mydomain".

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.

Create a cookie accessible to a domain A from a popup in a domain B

The functionality im trying to create is similar to how facebook connect works, in a domain A when a button is pressed a popup fires up, showing content from a domain B, on this popup if the user login a cookie is created and then the popup is closed, but since this cookie was created in the domain B i cant access that information from A. How facebook solve this? Im a javascript and PHP developer so if you provide me with a code example it will be very appreciated.
Cookies created in one domain can't be accessed from another domain. It can be managed with subdomains, but not with different domains. You will need to find a different solution to your issue.
I don't know what Facebook solution you are referring to, but as best I know, Facebook uses iframes on their own domain and thus they can access their own cookies from their iframe.
You can look at the oauth spec for one standard way that authorization is done between domains.
And, here's a reference on how Facebook Connect works: http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/

Oauth dialog redirection php in Facebook. How to redirect to app page

I am developing a Canvas application in Facebook in php. When the user allows the permission it's redirected to my site, as the say in the help page https://developers.facebook.com/docs/reference/dialogs/oauth/.
But I don't want to be redirected to my site, I want to be redirected to the facebook page which contains my site in an iframe. How can I do this? It should be quite straightway.
If the user clicks "Allow", they will be directed to
http://www.example.com/response#access_token=...& expires_in=3600
If the user clicks "Don't Allow", they will be directed to
http://www.example.com/response?
error=access_denied&
error_description=The+user+denied+your+request.
I don't want to go to example.com but to facebook.com/app/ID_APP which contains example.com
EDIT:
after Floyd Wilburn's answer, I tried to put my app page but it doesn't work. It gives me an error. While the right URL looks like this
https://www.facebook.com/dialog/permissions.request?app_id=53434949999999&display/=page&next=http%3A%2F%2Fwww.example.com%2Fapp%2F%3Fnext_url%3Dhttp%253A%252F%252Fapps.facebook.com%28403a2224870942%252F&response_type=code&fbconnect=1&perms=email%2Cread_stream
(we can see the my site url example.com encoded with a parameter 'next_url' to which the user will b redirected from my site page)
the URL of the wrong way looks like this (Just changin my site to my facebook app url )
https://www.facebook.com/dialog/oauth?client_id=185340534870942&redirect_uri=http%3A%2F%2Fapps.facebook.com%2F534349499999s992%2Fhello.php
So my solution is what I commented. The user gets to my site and is redirected to the facebook app URL.
Anyone can guess why Floyd Wilburn's solution doesn't work for me?
Thanks
Just set the redirect_uri parameter to point at http://apps.facebook.com/yourapp/somepage and it will go there instead.

Categories