httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Khine <nor...@khine.net>
Subject [users@httpd] rewrite advise
Date Fri, 27 Aug 2010 14:24:06 GMT
hello,
i have a menu that has a url as follows http://www.site.com/p/home
what is the correct way to have a domain point to the root of this?

so that http://partner.site.com shows the http://www.site.com/p/home
as the root of the site?

is this possibe to do in apache witha rewrite rule, what would this be?

i tried this and it works, but i still get the /p/home

i tried setting the RequestHeader set X-Base-Path p/home but still
does not work.

<VirtualHost *:80>
        ServerName site.com
        ServerAlias www.site.com
        ServerAdmin admin@site.com
        DocumentRoot "/var/www/site.com/htdocs/"
        <Directory "/var/www/site.com/htdocs/p/home">
                AllowOverride All
                Allow from all
        </Directory>
...
</VirtualHost>

<VirtualHost *:80>
        ServerName partner.site.com
        ServerAlias partners.site.com
        ServerAdmin admin@site.com
        DocumentRoot "/var/www/site.com/htdocs/"
        <Directory "/var/www/site.com/htdocs/p/home">
                AllowOverride All
                Allow from all
        </Directory>
        <IfModule mod_rewrite.c>
                RewriteEngine On
                RewriteRule ^/(.*) http://partner.site.com/p/home/$1 [L,R=301]
                RequestHeader set X-Base-Path p/home
        </IfModule>
        AccessFileName .htaccess
        RewriteLogLevel 9
        CustomLog /var/log/apache2/partner.site.com_access.log common
        RewriteLog /var/log/apache2/partner.site.com_rewrite.log
        ErrorLog   /var/log/apache2/partner.site.com_error.log
</VirtualHost>

is there a way to combine the two into one VirtualHost entry?

thanks


-- 
˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ ǝǝs noʎ 'ʇuǝɯɐן sǝɯıʇ ǝɥʇ puɐ 'ʇuǝʇuoɔ
ǝq s,ʇǝן ʇǝʎ
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message