重写URL .htaccess,mod_rewrite - “找不到目录”

I'm rewriting urls so my member pages - domain.com/profile.php?id=123 becomes domain.com/user/John

If somebody try to reach domain.com/user, the web browser says directory not found. Is there a way to make this directory "real", without adding the folder and an index file? In the .htaccess file?

When I call some scripts firebug will warn me about that the directory doesn't exists as well.

Here's the rewrite rule and entire .htaccess-file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
</IfModule>

RewriteRule ^user/([^/\.]+)/?$ profile.php?username=$1 [L]

"What should be rendered if user/ is submitted without a username following it?"

Doesn't matter really. Back to root I guess.

Then write a rule specifically for that:

RewriteRule ^user/?$ / [L]

Are you placing http:// before "domain.com" in your URL?

Your server will attempt to look for a file path if you do not specify the protocol.

It's been one year sonce your post, still you have saved me, for three days I've been searching for a solution as to why it won't read my slash instead it could read any other character You're getting 404 on user/ "folder" because you have no rules that apply to it without a username after it... – poncha Jun 24 '12 at 18:41 Thank you Poncha and Jon Lin