LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-02-2009, 07:32 AM   #1
urentity
Member
 
Registered: Jan 2009
Posts: 48

Rep: Reputation: 15
mod_rewrite: how to redirect but _not_ rewrite


Hi,

I suppose this belongs in an apache forum really, but I am trying to use that wonderful and mysterious package mod_rewrite, and am really trying to understand it by reading the docs carefully.

However, some of my confusion is not answered. For example the module rewrites URL's, but it actually ends up redirecting them. Ok, this is because of the hooks in apache it uses, but what happens when you want to redirect, but not rewrite?

I have an itnernational website, and I want a certain national domain to point to the international one, but without changing the URL.

Should I be using mod_rewrite at all?
 
Old 02-02-2009, 07:46 PM   #2
skibler1223
Member
 
Registered: Feb 2008
Distribution: Kubuntu 8.10
Posts: 40

Rep: Reputation: 16
Using the mod_rewrite module is like a scientific experiment sometimes rewrites turn into Frankensteins and sometimes they turn into something almost artistic.

You might have some luck using the P flag in a rewrite rule paired with a rewrite condition http host match to reverse proxy the request to the international site. If you have trouble accomplishing this I might be able to help. I'll need more information though like the domains involved.

BadReligion
 
Old 02-03-2009, 06:02 AM   #3
urentity
Member
 
Registered: Jan 2009
Posts: 48

Original Poster
Rep: Reputation: 15
Hi skibler1223,

thanks for the suggestion.

I'll look into it.

I can inform you of an interim solution, which feels a bit hackish (but then again, doesn't everything? ;-))

Because there's just one server from which both domainnames are usually served, I symlinked the www directory from the directory corresponding to domainname 1 over to the www directory corresponding to domainname 2.

This does the re-direct, and retains the odl domainname at least until you start clicking about in the new domainname(space).

Cheers!
 
  


Reply



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
mod_rewrite: redirect depending on subdomain mysql_connect Linux - Server 1 08-01-2007 06:23 AM
Top-Level Domain rewrite using mod_rewrite in Apache2 subcon Linux - Server 0 06-24-2007 11:33 PM
mod_rewrite, simple directory redirect? xconspirisist Linux - Software 3 12-20-2005 08:22 AM
WinXP will _NOT_ recognize fat32 partition gauntalus Linux - Software 2 12-24-2004 10:45 PM
USB mouse not found (slackware, _not_ an X config issue I think) ruahm Linux - Hardware 9 01-24-2004 02:53 PM

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

All times are GMT -5. The time now is 06:30 AM.

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