Reverse Proxy
-
We have two websites that are both running Apache:
Main Public Website: http://www.example.com –> just a regular old HTML Site
Worpress Blog: http://1.2.3.4/wordpress –> Just a WordPress blog and that’s it.On our main public website(http://www.example.com), we are looking to publish the WordPress Blog(http://1.2.3.4/wordpress) in a subdirectory without physically installing the site onto the public website server:
http://www.example.com/blogs-landing-page/wordpress-blog
The “blogs-landing-page” is a directory that points to the root of our WordPress server (http://1.2.3.4/) and contains an index.php file that basically displays a link to the “wordpress” subdirectory where our blog is located.
So in order to do this we set up a Proxy in the apache configuration file on our public website(http://www.example.com) using the following configuration:
ProxyPass /blogs-landing-page/ http://1.2.3.4/ ProxyPassReverse /blogs-landing-page/ http://1.2.3.4/ ProxyPreserveHost on RewriteRule ^/blogs-landing-page/$ http://www.example.com/blogs-landing-page/ [R]
This configuration successfully displays the landing page in our root directory(http://1.2.3.4/) at http://www.example.com/blogs-landing-page/ but won’t properly display the blog(http://1.2.3.4/wordpress) at http://www.example.com/blogs-landing-page/wordpress-blog/
Within WordPress, I’ve changed the HOME-URL and SITE-URL to just about every different variation I could think of:
* http://1.2.3.4/wordpress/
* http://1.2.3.4/
* http://www.example.com/
* http://www.example.com/blogs-landing-page/wordpress-blog/The only time the blog will work is if I set the HOME-URL to “http://1.2.3.4/wordpress/” which is not what we want because we want the URLs to display as “http://www.example.com/blogs-landing-page/wordpress-blog/”. What is weird is if I physically type in the URL’s for certain pages the pages will successfully load up:
ex:
- http://www.example.com/blogs-landing-page/wordpress-blog/about
- http://www.example.com/blogs-landing-page/wordpress-blog/2010/10/13/test-blog-post/
But if I change the HOME URL from “http://1.2.3.4/wordpress/” to “http://www.example.com/blogs-landing-page/wordpress-blog/” the pages will not display any content.
I have searched just about everywhere and it seems like people have successfully overcame this issue by setting up their site behind a proxy with a Virtual Host in the httpd.conf of Apache. I suggested this to the Server Admin who is helping me, but he says we are unable to set up a Virtual Host.
Any ideas? I’m desperate and would greatly appreciate any help!
- The topic ‘Reverse Proxy’ is closed to new replies.