LinuxQuestions.org
Help answer threads with 0 replies.
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 07-24-2008, 03:30 AM   #1
t0bias
Member
 
Registered: Aug 2005
Distribution: Fedora 13, RHEL 5.3, Ubuntu 10.04, Debian Lenny
Posts: 128

Rep: Reputation: 16
Unhappy mod_rewrite not redirecting


Hi,

I'm trying to redirect

wiki.foo.com ---> http://www.foo.com/moinwiki

therefore I added this to my httpd.conf:
Code:
<VirtualHost _default_:80>
    RewriteEngine on
    RewriteLog "/var/log/apache/rewrite.log"
    RewriteLogLevel 9

    RewriteRule ^wiki(.*)$ http://www.foo.com/moinwiki [R]
</VirtualHost>
in the rewrite.log I get:

Code:
[24/Jul/2008:10:24:56 +0200] [www.foo.com/sid#80c3974][rid#80b3c6c/initial] (2) init rewrite engine with requested uri /moinwiki
10.0.10.61 - - [24/Jul/2008:10:24:56 +0200] [www.foo.com/sid#80c3974][rid#80b3c6c/initial] (3) applying pattern '^wiki(.*)$' to uri '/moinwiki'
10.0.10.61 - - [24/Jul/2008:10:24:56 +0200] [wwwfoo.com/sid#80c3974][rid#80b3c6c/initial] (1) pass through /moinwiki
but I get www.foo.com instead of www.foo.com/moinwiki.

Can anyone help me?

Thanks,
 
Old 07-24-2008, 06:29 AM   #2
BlueC
Member
 
Registered: Aug 2007
Posts: 122

Rep: Reputation: 17
You need a virtualhost for wiki.foo.com as follows:

Code:
<VirtualHost _default_:80>
    ServerName wiki.foo.com
    RewriteEngine on
    RewriteRule ^(.*)$ http://www.foo.com/moinwiki [R]
</VirtualHost>
(wiki.foo.com must be in the foo.com DNS zone file for this to work)

Clearly you then need another virtualhost to host the www.foo.com domain.
 
Old 07-25-2008, 04:53 AM   #3
t0bias
Member
 
Registered: Aug 2005
Distribution: Fedora 13, RHEL 5.3, Ubuntu 10.04, Debian Lenny
Posts: 128

Original Poster
Rep: Reputation: 16
Thanks for your answer,
I did as advised, but the result is still the same....
 
  


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
Help with mod_rewrite MicahCarrick Linux - Software 3 05-23-2007 08:09 PM
mod_rewrite mr_dizzle Linux - General 1 02-02-2006 07:32 PM
mod_rewrite questions? cadkins Linux - Software 0 03-25-2005 11:02 AM
mod_rewrite help needed j-ray Linux - General 1 03-09-2005 04:41 PM
Mod_Rewrite help in Apace 1.3... vrillusions Linux - Software 0 08-11-2003 09:18 PM

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

All times are GMT -5. The time now is 06:09 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