tags:

views:

18

answers:

3

http://mydomain.com/bubba

goes to http://mydomain.com/myscript.php?name=bubba

But does not match anything with an extension on it (.php, .html, etc).

I've been working on this for the last several hours and I cannot see how to do it. Every piece of documentation I find specifically doesn't work.

I'm doing this on a shared host (1and1.com) with .htaccess

+1  A: 

Rewrites every non-existant file to myscript.php?name=requested:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ myscript.php?name=$1 [QSA,L]
Lekensteyn
This produces an internal server error for me
Fred
Strip the space after `!`.
Lekensteyn
A: 

Maybe you want RewriteCond -f, to check whether the file exists.

Sjoerd
A: 

To only match things without a period:

^([^.]+)$ myscript.php?name=$1 [QSA,L]
Sjoerd
almost, the only problem is that it's matching http://mydomain.com also
Fred