yet another subdomin question

Discussion in 'Installation/Configuration' started by jag7720, Mar 5, 2008.

  1. jag7720

    jag7720 New Member

    My site is and I need the DocumentRoot to be /var/www/web1/web/catalog

    Then I need to have a subdomain with a DocumentRoot of /var/www/web1/web

    How can I accomplish this without a manual edit of the apache conf?

  2. edge

    edge Active Member Moderator

    You could use a .htaccess file for this.
    Something line this should work.
    RewriteEngine on
    RewriteBase /
    RewriteCond %{HTTP_HOST} www\.mysite\.com
    RewriteRule (.*) http://www\.mysite\.com/catalog/index.html$1 [R=301,L]
    RewriteCond %{HTTP_HOST} acc\.mysite\.com
    RewriteRule (.*) http://acc\.mysite\.com/web/index.html$1 [R=301,L]
  3. jag7720

    jag7720 New Member

    How do I get that to work with the the following already in the virtualhost config

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/oscatalog/.*$
    RewriteCond %{REQUEST_URI} !^/oslanguages/.*$
    RewriteCond %{REQUEST_URI} !^/osimages/.*$
    RewriteCond %{REQUEST_URI} !^/uploads/.*$
    RewriteCond %{REQUEST_URI} !^/fileopen\.php$
    RewriteRule ^/(.*)$ /oscatalog/$1 [NC,L]

Share This Page