LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-30-2006, 08:43 AM   #1
mrjamin
LQ Newbie
 
Registered: Sep 2003
Location: UK
Distribution: FC7
Posts: 27

Rep: Reputation: 15
Virtual VirtualHosts in apache with mod_rewrite - help!


Hello All,

Having read numerous threads and tutorials round t'interweb, I'm still as confused as I was before I started! Let me explain my situation:

We have a webserver used to host all of our "websites in development" in the office. At present, each site is in its own folder within the document root. I.e. "/www/htdocs/projectname", so their URLs are: www.mywebsite.com/projectname

What I'd like to do is set up each site in development with its own subdomain, which then transparently redirects to the relevant folder, i.e. projectname.example.com to example.com/projectname

Obviously, this could be achieved with a virtual host per project, but surely this can be achieved with mod_rewrite? My DNS is set up correctly (wildcard A record), but all the examples I've tried have either broken www.example.com, or simply redircted all subdomains to the document root.

So, does anybody have a solution?

Thanks!
 
Old 01-30-2006, 09:16 AM   #2
mrjamin
LQ Newbie
 
Registered: Sep 2003
Location: UK
Distribution: FC7
Posts: 27

Original Poster
Rep: Reputation: 15
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^.])+\.example\.com$ [NC]
RewriteRule ^(.*)$ /%1/$1 [L]
That's the most promising attempt so far, but I'm getting "mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary" thrown back at me!

Any ideas?|
 
  


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
virtual host redirects with mod_rewrite sqn Linux - Software 1 10-11-2005 08:47 PM
Apache VirtualHosts and VSFTPd critical Linux - Software 3 09-14-2005 02:12 PM
Apache VirtualHosts Problem stratisphere Linux - Newbie 4 11-27-2004 12:20 AM
VirtualHosts & apache 2.0.48 TiCkO Linux - Networking 2 07-13-2004 03:20 PM
Virtualhosts in apache. where am i going wrong. SSBN Linux - Networking 20 07-11-2003 04:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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