I have a php website running on an IIS8 server. I also have a WordPress blog hosted on another server. I would like for the blog to show up under the same domain as the main site.
For example, www.mysite.com is hosted on server A. The blog is hosted on server B. The domain name is set to server A. When a user navigates to www.mysite.com they get the main website hosted on server A. When the user navigates to www.mysite.com/posts, I need them to see the blog hosted on server B. Is this possible? I'm not sure if I can use a cname, if I need to configure something in IIS or if there is another way to accomplish this.
As you describe it, www.mysite.com/blog might not be the easiest or cleanest solution. If you are able to, using a sub-domain would be better.
The blog would end up at blog.mysite.com or whatever you want. Site A would still be at www.mysite.com.
Well I can see there being several options here. The iframe suggestion I don't think quite fits your requirement of typing a URL and then it redirecting.
You could add a simple domain redirect for example mysite.com/posts redirects too Server B. You could look at using rewirte URL's on IIS. See the URL rewrite extension here.
Yes, you can simply call an API from server B that will fetch blog data and return the output
Create an API function on Server A that returns the blog post data (in array/object format)
Related
I am setting up a WordPress site hosted on a home server. On the WordPress site, I have managed to upload a purchased template and import sample content. This means that the website should display exactly like the demo. From WordPress, when I view the website from the local machine (the home server), It displays all of the content that I uploaded. But when I connect to the website from any client, the backgrounds displays, but not the images. I used a plugin called cherryframework4.
http://74.208.12.48/index.php that is the link to the site... in looking at the console logs, I can see that most files filed to load. but all the files exist are in the directories.
it is also worth mentioning that i used cherrframework4 as a plugin to install the site
Happens regularly when moving from localhost to live site or from temporary URL to live. It's looking for images on the initial build platform (e.g. your machine or temporary URL) rather than from the live server:
It's looking for: localhost:8888/path-to-image/image.jpg
Should be looking for: domainname.com/path-to-image/image.jpg
Try using the search and replace plugin to search for instances of localhost:8888 (or whatever your machine is called) and replace it with the live domain name.
Be careful to check the URL in the code to extract and change only the part of the string that needs it.
Settings>general I changed the WordPress address and the site URL address to the ip address of my server. What has happening was that, because the url was set to http://localhost, the client machine was looking for the images in its own drive.
I don't know if it is even possible so that's why I put my question here.
We have a webserver running a PHP application build within the Yii-framework and we have also integrated Wordpress into that application.
The root contains the Yii-application and a dir with the wordpress installation. Now I would like to know if it's possible to create a page and have it a url outside it's installation dir.
An example:
domain.com shows the Yii application index
domain.com/blog shows the Wordpress homepage
Now I want to create domain.com/foobar and the page foobar comes from Wordpress.
Is it possible and how?
Kind regards,
Pim
Your server will have been setup with your domain name. I don't know if you are using a hosted service, or a cloud based option, but either way you should be able to tell your web server to load different index.php files based on the URL.
Every single web request comes through your web server. You can tell your web server to load different php files depending on the http request URL.
For example, when you setup your sever with domain.com you would have had to (or in most cases its the default) tell your web server to route all domian.com requests to /public/index.php
Following this logic, if you want to load a different index.php file from a different URL, you just have to set this up in your web server. So domain.com/foobar would point to /some/directory/public/index.php
The way you do this very much depends on your server and if you have some server admin software installed e.g. cPanel.
I have WordPress installed and running on GAE and have added my own custom domain via Google Apps. This is great but my appspot.com url is still publicly accessible and searchable.
How would I go about blocking this and redirecting to my custom domain?
I imagine it involves adding a url handler in the app.yaml file that points to a php file. I have no idea what would go inside though.
Also, how would I then go about setting up a 301 redirect for website canonisation and SEO that accounts for SSL and cron entries?
Any help is appreciated, thanks!
The appspot.com URL is always accessible and there is no way to turn it off. You can't do much in the app.yaml since it's not aware of the custom domain. I'm not really a PHP guy but you should do is to write manually the redirect based on the host URL if you really want to do that. Since you're using WordPress you might need to do quite some work if you don't want to redirect only from the root, but from any page.
Personally I think you should just leave it there and do nothing, even Khan Academy is not redirecting (http://khan-academy.appspot.com) and I'm pretty sure that very few are actually doing that.
First
Let say that i have www.domain.com that are client site and user login and do all the thing that he want (site is main and he use POST method for login adn other things and HEADER redirect if login are success)
But i not want user to see original www.domain.com i want when they enter www.name.com/dashboard.php to see content from www.domain.com/dashboard.php but him URL bar to show www.name.com/dashboard.php ..and like this all other page that can have original www.domain.com
I found this site:
http://www.htmlremix.com/css/permanent-url-masking-for-mirroring-website-using-php-and-htaccess
Adn use script but when are entered user login detail noting happen!! Just home page reload.
I try everything that i think may be cause problem and not found how to solv it .. So please help me!!
Thanks Allot
P.S. If have some more good way that can i use also will help me!
that cant be achieve with a htaccess file.
You need different things.
possible solution could be:
apache mod proxy so you could proxy everything through that url.
the other way could be a php written some kind of proxy. Working with curl or and remote configured fopen.
But be careful to also send the post data and the cookies, otherwise the user session could not be handled if its cookie based.
If both domains are on the same server you could easily set this up with a vhost configuration in apache/nginx what ever you are using.
i'm building a site for my company, this site will be in some way like facebook or other social sites, and the user will have a public profile page. I can't find, or maybe i don't know where to look for, any information on how to do something to create that public page without creating a specific page for each user, i want to do something like facebook does when you type a username after the facebook url (EX. http://www.facebook.com/ANYUSERNAME) and then you fall into the profile page, somebody can help me with an idea? The development server is a windows 2008 using IIS 7.5 and PHP but the production server will be mandriva or any other linux distro with apache and php. Thnxs a lot to everyone in advance.
dynamic URLs are done on most Unix/Linux based systems in Apache, by a plugin called 'mod_rewrite'. However, you are running windows. IIS has a rewrite plugin by Microsoft.
http://www.iis.net/download/URLRewrite
Essentially the behavior ends up being that you set up rules for specific folders or other things. If a page doesn't physically exist on disk, or doesn't end in .php, run the ruleset. if it matches the rule, pass it to a real page as a querystring or other variable to the codepage. If it doesn't exist, throw a 404.
You'll need mod_rewrite (for IIS) and implement the front-controller pattern (usually in index.php).
The front-controller will then check the first segment of the URL (in your example it'll be ANYUSERNAME) and, if that route doesn't exist you can assume it's a user profile page. You can then choose to redirect the user to that specific profile page (something like /profile/USER), or just display it directly.