Well, it all depends on what would be the variables content and how you'd catch it by the script.
If the variable only contains a text strig without spaces, you could go for something like :
- Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-z0-9]+)$ /script.php?var=$1 [QSA,L,NC]
We need the rewritecond here to first make sure a physical file with the same name as the text string sent does not really exist, in such case, we give it the priority to let it load.
If you where using a folder with only script.php in it, you could have the reg-ex working faster with only :
- Code: Select all
RewriteRule ^folder/([a-z0-9]+)$ /folder/script.php?var=$1 [QSA,L,NC]
But this is only a possible example, what would you put into this added field, and what would you like to do with it ?
++