[development] htaccess help

Randy Fay randy at randyfay.com
Mon Nov 15 16:39:51 UTC 2010


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.

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.

-Randy

On Mon, Nov 15, 2010 at 9:36 AM, Ryan LeTulle <bayousoft at gmail.com> wrote:

> Why do you need a redirect if your document root points into that folder
> (bv) already?
>
> Ryan LeTulle
>
> bayousoft.com <http://www.bayousoft.com>
> twitter.com/bayousoft <http://www.twitter.com/bayousoft>
>
>
>
>
>
> On Mon, Nov 15, 2010 at 10:23 AM, Lynn Stott (Stott Design) <
> lynn at stottdesign.com> wrote:
>
>> Thanks, but using document root gives me a 505 Internal server error.
>>
>> Let me explain better:
>> 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
>>    RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
>>    RewriteRule ^(.*)$ http://www. mysite.com/bv/$1 [L,R=301]
>> so when I browse to the home page, www.mysite.com, I'm redirected to
>> www.mysite.com/bv  OR
>> mysite.com  I'm redirected to www.mysite.com/bv
>>
>> BUT, when I browse to any internal pages without the /bv, I get a page not
>> found. For example:
>> www.mysite.com/contact  will not redirect to www.mysite.com/bv/contact
>>
>> Is there a wildcard redirect so any internal page is redirected to include
>> the /bv ?
>>
>>
>>
>> On Nov 15, 2010, at 8:31 AM, Ryan LeTulle wrote:
>>
>> I may not totally understand your question but why don't you set your
>> DocumentRoot to point into that folder?
>>
>> *DocumentRoot "/path/to/bv"*
>>
>>
>> Ryan LeTulle
>>
>> bayousoft.com <http://www.bayousoft.com>
>> twitter.com/bayousoft <http://www.twitter.com/bayousoft>
>>
>>
>>
>>
>>
>> On Mon, Nov 15, 2010 at 9:23 AM, Lynn Stott (Stott Design) <
>> lynn at stottdesign.com> wrote:
>>
>>>  I have a Drupal site installed at /bv, so home page is
>>> www.mysite.com/bv
>>> I want to be sure when anyone tries www.mysite.com/anypage, they get
>>> redirected to www.mysite.com/bv/anypage
>>> Is this possible via htaccess?
>>>
>>> I currently have this rewrite to be sure the www is included (needed for
>>> SSL):
>>>    RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
>>>    RewriteRule ^(.*)$ http://www. mysite.com/bv/$1 [L,R=301]
>>>
>>> Thanks for any help.
>>>
>>> Lynn
>>>
>>> *
>>> *
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>


-- 
Randy Fay
Drupal Module and Site Development
randy at randyfay.com
+1  970.462.7450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20101115/12e365e0/attachment.html 


More information about the development mailing list