Where are you putting this code? It was apparently written for use in a server configuration file outside of any <Directory> containers. For use in .htaccess, it would need to be changed slightly. As well, a correction is needed to conform to your stated requirement, and a 41% efficiency improvement is possible simply by using [NC]:
# Internally rewrite requests for URL-path /<letters-numbers-hyphens> # to server filepath /itemout.php?id=<letters-numbers-hyphens> RewriteRule ^([a-z0-9\-]+)$ itemout.php?id=$1 [NC,L]
Jim
Prasawet
10:20 pm on Feb 17, 2011 (gmt 0)
Yes, it is for use in a server configuration file outside dir.
I solved it with:
RewriteRule ^(.*)$ itemout.php?xurl=$1[L]
NC
...very useful remark...thanks!
jdMorgan
4:04 am on Feb 18, 2011 (gmt 0)
If you want to rewrite requests for /foo to /itemout.php?xurl=foo instead of /itemout.php?xurl=/foo then use:
RewriteRule ^/(.*)$ /itemout.php?xurl=$1 [L]
Note also the leading slash on "itemout" and the required space before "[L]"