Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess frustration with subdomain

Status
Not open for further replies.

marvinzzz

Programmer
Jan 8, 2009
1
CN
Under the Zend Framework, I have a directory structure like this:

Index: /domains/example.com/public_html/public/index.php

Blog index: /domains/example.com/public_html/blog/index.php

In my .htaccess file, shown below is the piece that points to the homepage - this works fine:

RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]

RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]

RewriteRule ^public/.*$ /public/index.php [NC,L]
I have enabled a subdomain in my host admin control panel and now I want to add a blog which is accessible via: blog.example.com

I tried adding:

RewriteCond %{HTTP_HOST} = ^RewriteRule /blog/(.*) [L,R=301]

RewriteCond %{HTTP_HOST} = ^blog\.example\.com$
RewriteRule ^.*$ /blog/index.php [L]
but this produces a dreaded "Internal Server Error - 500" when navigating to blog.example.com, example.com/blog and even example.com..

I suspect that it could be a complication with the Zend Framework that's causing grief. What should I add / edit in .htaccess for blog.example.com to point correctly ?

Please & thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top