开发者

cakephp .htaccess configuration on godaddy with subdomain

I have one domain on godaddy (www.mydomain.com). I have placed my cakephp application on this domain. It is working fine for me.

But i have created a subdomain blog.mydomain.com for this godaddy has created a directory named blog inside the www.mydomain.com now how can i redirect the request coming for blog.mydomain.com to the blog/ folder.

I am trying this,

RewriteEngine On

RewriteCond %{HTTP_HOST} ^blog.mydomain.com$
RewriteRule ^(.*)$ blog/$1    [L]

RewriteCond %{HTTP_HOST} ^mydomain.com/$
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]

It works for single Rewrite cond开发者_运维技巧ition like,

RewriteEngine On

RewriteCond %{HTTP_HOST} ^blog.mydomain.com$
RewriteRule ^(.*)$ blog/$1    [L]

But when i add another rewrite condition for my cake app it shows 500 Internal server error for blog.mydomain.com

Please help me out .............


Put the blog folder in webroot (under your cake directory) and it should work just fine. Or did you need to do something else more fancy?


Try this: http://digitalmemo.neobie.net/2011/04/19/cakephp-bypassing-for-subdomain/

It use to make all the subdomains to be working correctly instead of defining each of the subdomain.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜