Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-03-2011, 04:36 PM
|
#1
|
Member
Registered: Nov 2009
Distribution: All flavors...
Posts: 37
Rep:
|
How to redirect from one page to another using apache and still retain original url?
Hi,
quesiton is how I can redirect http://www.thispage.com to http://my.page.com and still retail displaying http://www.thispage.com.
The issue is if I point in httpd.conf to directory where my.page.com it doesnt work because it knows it address.
Is there some other way?
Thx
Julie
|
|
|
04-03-2011, 05:24 PM
|
#2
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
It depends if they're on the same server.
If you have control over both domains, then use name based virtual hosting and use the ServerAlias directive to alias www.thispage.com to the virtual host of my.page.com
You only need my.page.com to exist as a physical site with files.
http://httpd.apache.org/docs/2.0/mod...ml#serveralias
Last edited by smoker; 04-03-2011 at 05:28 PM.
|
|
|
04-03-2011, 05:39 PM
|
#3
|
Member
Registered: Nov 2009
Distribution: All flavors...
Posts: 37
Original Poster
Rep:
|
Quote:
Originally Posted by smoker
|
Thats what I did first time but it didnt work since moodle somehow konws its address and when I do that it transfers over and shows error....there is some module for rewriting addresses....
|
|
|
04-04-2011, 12:49 AM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
|
@OP
You can use a combination of mod_rewrite and mod_proxy to do what you want (if I can understand well what it is).
In the VirtualHost www.thispage.com definition use:
Code:
RewriteEngine on
RewriteRule (.*) http://my.page.com/$1 [P]
ProxyPassReverse / http://my.page.com/
|
|
1 members found this post helpful.
|
04-04-2011, 03:54 PM
|
#5
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
It strikes me that if you try to get apache to mask or alias an address, then transfer that address to something (an app) that does it's own thing, you are in serious danger of creating a loop.
Personally I would try to get moodle to stop fighting back, rather than trying to get apache to overpower moodle.
jm2c
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 04:12 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|