Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-29-2003, 11:17 PM   #1
LQ Newbie
Registered: Dec 2003
Posts: 2

Rep: Reputation: 0
mod_rewrite & regex problem

hi, i'm trying to get the following to work in my .htaccess ... this regex thing is making my brain bleed 8-)

RewriteRule (.*) /%(HTTP_HOST)/$1

i have 3 domains all aliased to the same virtual server. i would like the rewriterule to direct apache to the proper directory and use the files in it without having to write a new rule for each domain... the regex rule should work to any depth of subdirs on any kind of file... example mappings would be like...

would go lookup files in


any assistance would be very much appreciated

happy new year!
bill bush
Old 12-30-2003, 07:19 AM   #2
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
This looks more like a job for virtual hosts more than mod_rewrite.
Old 12-30-2003, 11:19 AM   #3
LQ Newbie
Registered: Dec 2003
Posts: 2

Original Poster
Rep: Reputation: 0
u right about that ugob... that's how i do it on my home server in the httpd.conf file... unfortunately i'm trying to do this under ensim on a shared server. i have no access to httpd.conf and if i create a virtual server for each domain under ensim it's a separate user account and i cannot control what the directories are and a bunch of other crap you don't think about till you actually try to do it muahahaha... the best i could do was get the sysadmin to give me mod_rewrite... so i'll just take the performance hit .htaccess mod_rewrite incurrs until a better solution comes along...


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
regex problem with sed ta0kira Programming 7 06-20-2005 12:33 AM
Mod_rewrite install problem gobrien Linux - Newbie 1 06-04-2005 04:30 PM
mod_rewrite problem jfall Programming 1 02-22-2005 07:05 PM
Suse 9.1 Pro & htaccess file: mod_rewrite not loading sorenson2743 SUSE / openSUSE 2 12-03-2004 11:36 PM
Apache & mod_rewrite Modify Linux - Software 0 12-12-2003 08:25 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:32 PM.

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