# .htaccess to pass/ignore directory

**URL:** <https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903>\
**Category:** Rails\
**Created:** [April 16, 2008, 1:16am UTC](https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903 "2008-04-16T01:16:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlshea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@karlshea](https://www.ruby-forum.com/u/karlshea)\
**Post date:** [April 16, 2008, 1:16am UTC](https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903/1 "2008-04-16T01:16:40Z")

</div>

I have a subdomain, [blog.mysite.com](http://blog.mysite.com), that points to /home/myname/  
public\_html/blog  
My rails app sits at /home/myname/myrailsapp  
I have a symlink from /home/myname/public\_html → /home/myname/  
myrailsapp/public  
And another symlink from /home/myname/myrailsapp/public/blog → /home/  
myname/blog

This way my rails app and the blog subdomain sit outside of the /  
public\_html. Just makes it easier to update the rails app so that I  
don’t mistakenly delete the blog subdomain. At worst, I would only  
delete a symlink.

OK?

I need a .htaccess rewrite so that [http://blog.mysite.com](http://blog.mysite.com) does not get  
rewritten into rails. So I tried what is suggested in the  
default .htaccess:

RewriteCond %{REQUEST\_URI} ^/blog.\*  
RewriteRule .\* - [L]

But that does not work, the rails app works just fine.

Anyone have some suggestions for a rewrite that will work in this case?

---

<div class="post-metadata">

**Author:** ![karlshea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@karlshea](https://www.ruby-forum.com/u/karlshea)\
**Post date:** [April 16, 2008, 2:26am UTC](https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903/2 "2008-04-16T02:26:50Z")

</div>

On 16 Apr 2008, at 00:16, Karl S. wrote:

> OK?
> 
> I need a .htaccess rewrite so that [http://blog.mysite.com](http://blog.mysite.com) does not get  
> rewritten into rails. So I tried what is suggested in the  
> default .htaccess:
> 
> RewriteCond %{REQUEST\_URI} ^/blog.\*  
> Shouldn’t that be RewriteCond %{REQUEST\_URI} ^blog.\*  
> ?  
> Fred

---

<div class="post-metadata">

**Author:** ![karlshea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@karlshea](https://www.ruby-forum.com/u/karlshea)\
**Post date:** [April 16, 2008, 5:30am UTC](https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903/3 "2008-04-16T05:30:29Z")

</div>

Tried that. Sorry, doesn’t work.

On Apr 15, 5:25 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Shouldn’t that be RewriteCond %{REQUEST\_URI} ^blog.\*

Anymore ideas?

---

<div class="post-metadata">

**Author:** ![karlshea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@karlshea](https://www.ruby-forum.com/u/karlshea)\
**Post date:** [April 16, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903/4 "2008-04-16T23:10:08Z")

</div>

I can’t enable logging. I don’t have access to httpd.conf.

> Turn on the mod\_rewrite logging so tht you can see exactly what is  
> going on.

Is there something else I can try?

---

<div class="post-metadata">

**Author:** ![karlshea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@karlshea](https://www.ruby-forum.com/u/karlshea)\
**Post date:** [April 16, 2008, 10:00am UTC](https://www.ruby-forum.com/t/htaccess-to-pass-ignore-directory/134903/5 "2008-04-16T10:00:45Z")

</div>

On Apr 16, 4:29 am, Karl S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Tried that. Sorry, doesn’t work.
> 
> On Apr 15, 5:25 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Shouldn’t that be RewriteCond %{REQUEST\_URI} ^blog.\*
> 
> Anymore ideas?  
> Turn on the mod\_rewrite logging so tht you can see exactly what is  
> going on.
