title: apache htaccess rewrite with alias
body: <p>We are changing our domain name and this is meant to work for stand alone applications. In Apache virtual host file the DocumentRoot is /var/www/website/html, not /var/www/example/html as in this block:</p>
  
  <pre><code>Alias /apps/dept /var/www/example/html/apps/dept
  &lt;Directory "/var/www/example/html/apps/dept/"&gt;
     Options FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>I put an .htaccess file in /var/www/example/html/apps/dept directory as follows:</p>
  
  <pre><code> RewriteEngine On
   RewriteBase /apps/dept/
   RewriteCond %{HTTP_HOST} ^example.orgname.state.tx.us/apps/dept [NC]
   RewriteRule ^(.*)$ http://example.orgname.texas.gov/apps/dept/$1 [L,R=301]
  </code></pre>
  
  <p>This seems to follow what is recommended here, <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" rel="nofollow noreferrer">http://httpd.apache.org/docs/current/mod/mod_rewrite.html</a> and <a href="https://stackoverflow.com/questions/9251305/apache-how-to-use-rewrite-engine-inside-alias">Apache : How to Use Rewrite Engine Inside Alias</a>. I see no results. The new domain has a virutal host config in the VH file, also. This same basic rewrite works for our Drupal website which does not use an alias. What changes might be necessary to have the domain name rewritten with an appended application pathname? Is the RewriteBase incorrect? </p>
  
  <p>Thx.</p>