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?

Adam
  • 31
  • 5

1 Answers1

1

OK. . .

After a while struggling with the rules I found the answer:

RewriteCond %{HTTP_HOST} ^([^/.]+)\.example\.com$ 
RewriteCond %1 !^(www|ftp|mail)$ [NC]
RewriteRule (.+)$ "http://example.com/user/%1" [L,P]
Adam
  • 31
  • 5