If you have control of the apache configuration, please consider just changing where the sitename points to. That's a much more obvious way to accomplish this. Point it into the subdirectory. Doing redirects in the htaccess is not really the place to do it.<br>
<br>On debian/ubuntu, this would usually be done in the /etc/apache2/sites-available. There are similar ways of doing it anywhere Apache is installed.<br><br>-Randy<br><br><div class="gmail_quote">On Mon, Nov 15, 2010 at 9:36 AM, Ryan LeTulle <span dir="ltr"><<a href="mailto:bayousoft@gmail.com">bayousoft@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Why do you need a redirect if your document root points into that folder (bv) already?<div><div class="im">
<br clear="all">Ryan LeTulle<br><br><a href="http://www.bayousoft.com" target="_blank">bayousoft.com</a><br><a href="http://www.twitter.com/bayousoft" target="_blank">twitter.com/bayousoft</a><br>
<br><br><br>
<br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On Mon, Nov 15, 2010 at 10:23 AM, Lynn Stott (Stott Design) <span dir="ltr"><<a href="mailto:lynn@stottdesign.com" target="_blank">lynn@stottdesign.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;">Thanks, but using document root gives me a 505 Internal server error.<div><br></div><div>Let me explain better:</div><div>I've just inherited this site, so I'm not sure why it was set up this way, but the full Drupal site is in the folder: /bv (DocumentRoot /home/mysite/public_html/bv). I currently have the following rewrite in the .htaccess file within the /bv folder</div>
<div><div><div> RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]</div><div> RewriteRule ^(.*)$ <a href="http://www" target="_blank">http://www</a>. <a href="http://mysite.com/bv/$1" target="_blank">mysite.com/bv/$1</a> [L,R=301]</div>
</div></div><div>so when I browse to the home page, <a href="http://www.mysite.com" target="_blank">www.mysite.com</a>, I'm redirected to <a href="http://www.mysite.com/bv" target="_blank">www.mysite.com/bv</a> OR</div>
<div><a href="http://mysite.com" target="_blank">mysite.com</a> I'm redirected to <a href="http://www.mysite.com/bv" target="_blank">www.mysite.com/bv</a></div><div><br></div><div>BUT, when I browse to any internal pages without the /bv, I get a page not found. For example:</div>
<div><a href="http://www.mysite.com/contact" target="_blank">www.mysite.com/contact</a> will not redirect to <a href="http://www.mysite.com/bv/contact" target="_blank">www.mysite.com/bv/contact</a></div><div><br></div><div>
Is there a wildcard redirect so any internal page is redirected to include the /bv ?</div><div><div></div><div><div><br><div> <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;">
<div><div><div><div><div><font face="'Century Gothic'"><font face="Helvetica"><br></font></font></div></div></div></div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div>
</div><br><div><div>On Nov 15, 2010, at 8:31 AM, Ryan LeTulle wrote:</div><br><blockquote type="cite"><div>I may not totally understand your question but why don't you set your DocumentRoot to point into that folder?</div>
<div><br></div><div><i>DocumentRoot "/path/to/bv"</i></div><div><br></div><div><br></div> Ryan LeTulle<br><br><a href="http://www.bayousoft.com" target="_blank">bayousoft.com</a><br><a href="http://www.twitter.com/bayousoft" target="_blank">twitter.com/bayousoft</a><br>
<br><br><br> <br><br><div class="gmail_quote">On Mon, Nov 15, 2010 at 9:23 AM, Lynn Stott (Stott Design) <span dir="ltr"><<a href="mailto:lynn@stottdesign.com" target="_blank">lynn@stottdesign.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div style="word-wrap: break-word;">
I have a Drupal site installed at /bv, so home page is <a href="http://www.mysite.com/bv" target="_blank">www.mysite.com/bv</a><div>I want to be sure when anyone tries <a href="http://www.mysite.com/anypage" target="_blank">www.mysite.com/anypage</a>, they get redirected to <a href="http://www.mysite.com/bv/anypage" target="_blank">www.mysite.com/bv/anypage</a></div>
<div>Is this possible via htaccess?</div><div><br></div><div>I currently have this rewrite to be sure the www is included (needed for SSL):</div><div><div> RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]</div><div> RewriteRule ^(.*)$ <a href="http://www/" target="_blank">http://www</a>. <a href="http://mysite.com/bv/$1" target="_blank">mysite.com/bv/$1</a> [L,R=301]</div>
<div><br></div><div>Thanks for any help.</div><div><br></div><div>Lynn</div></div><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Century Gothic'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="word-wrap: break-word;">
<div><div><div><div><div><br></div></div></div><i><font size="3"><span style="font-size: 12px;"><span style="font-style: normal; font-size: medium;"><br></span></span></font></i></div><br></div><br></div></span><br></div>
</span><br>
</div></span><br></div></span><br></div></span><br></div></span><br></div></span><br></div></span><br> </div><br></div></blockquote></div><br></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Module and Site Development<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>