logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: httpd.conf IfModule mod_rewrite.c
Author
wolli



Joined: 20 Dec 2006
Posts: 1

PostPosted: Wed 20 Dec '06 21:04    Post subject: httpd.conf IfModule mod_rewrite.c Reply with quote

hi,

<IfModule mod_rewrite.c>
RewriteEngine on
rewritecond %{HTTP_HOST} ^(www\.)?(.*)$
rewriterule (.*) /home/vhosts/%2$1
</IfModule>

with this rule i get:
domain.tld > /home/vhosts/domain.tld/
www.domain.tld > home/vhosts/domain.tld/
domain.tld/dir/file.xyz > home/vhosts/domain.tld/dir/file.xyz
sub.domain.tld > home/vhosts/sub.domain.tld/
sub1.sub.domain.tld > home/vhosts/sub1.sub.domain.tld/

the problem is the subdomains
the subdomains goes to:
sub.domain.tld > home/vhosts/sub.domain.tld/
sub1.sub.domain.tld > home/vhosts/sub1.sub.domain.tld/

but the subdomains must go to:
sub.domain.tld > home/vhosts/domain.tld/sub/
sub1.sub.domain.tld > home/vhosts/domain.tld/sub/sub1

But i dont now how i can change this in the cond ore rule

thanks for your help
wolli
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 15 Apr '07 14:26    Post subject: Reply with quote

http://forum.modrewrite.com/
Back to top


Reply to topic   Topic: httpd.conf IfModule mod_rewrite.c View previous topic :: View next topic
Post new topic   Forum Index -> Apache