LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-03-2011, 04:36 PM   #1
peterson.julia
Member
 
Registered: Nov 2009
Distribution: All flavors...
Posts: 37

Rep: Reputation: 1
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
 
Old 04-03-2011, 05:24 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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.
 
Old 04-03-2011, 05:39 PM   #3
peterson.julia
Member
 
Registered: Nov 2009
Distribution: All flavors...
Posts: 37

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by smoker View Post
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
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....
 
Old 04-04-2011, 12:49 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
@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.
Old 04-04-2011, 03:54 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache redirect url Radioactiveman Red Hat 1 07-29-2009 01:40 PM
Attempting to record the redirect url using wget and logging in in seperate page onesikgypo Programming 1 02-11-2009 04:33 PM
How to redirect URL in apache chnlinux Linux - Newbie 1 01-08-2009 04:15 AM
URL redirect in apache maniannam Linux - Server 2 01-05-2009 01:03 AM
Apache URL issue - will redirect help... rlprofessional Linux - Newbie 9 06-16-2006 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration