As I rather think that you want to rewrite requests of /script/3295
to /script.php?id=3295
and not the other way round, try this:
RewriteRule ^/script/([0-9]+)$ /script.php?id=$1
But if you really want to rewrite script.php?id=3295
to script/3295
, try this:
RewriteCond %{QUERY_STRING} ^(([^&]*&)*)id=([0-9]+)&?([^&].*)?$
RewriteRule ^/script\.php$ /script/%3?%1%4
And if you want to use that rule in a .htaccess file, remove the leading slash from the pattern.
To your second question: The RewriteCond
directives test if the requested URI cannot be mapped to an existing regular file (!-f
), not to an existing directory (!-d
) and not to an existing symbolic link (!-l
).