2

First of all - I've read a lot of similar questions but nothing worked for me.

These are the rewrite rules:

RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$ 
RewriteRule ^ index.php?user=%1 [L]

It works fine but it's not exactly what I want. I'm running a MVC framework like kohana where the url structure looks like this:

example.com/controller/action/parameter

but when I try the following rewrite I'm getting an internal server error:

RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$ 
RewriteRule ^ index.php/user/view/%1 [L]

So, how can I fix this?

4

1 に答える 1

1

わかった。。。

ルールに苦労してしばらくして、私は答えを見つけました:

RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$ 
RewriteCond %1 !^(www|ftp|mail)$ [NC]
RewriteRule (.+)$ "http://example.com/user/%1" [L,P]
于 2012-11-06T07:26:45.173 に答える