I am attempting to convert a subdirectory to some variable to be used inside a query.


domain/subdir/STRING (Require the "STRING" subdir)

transformed into:


All I am getting are Internal Server Errors and 404's and also the phpinfo() for many odd reason.


Attempted the data in this article already: http://corz.org/serv/tricks/htaccess2.php


This seems to become working. RewriteRule ^([a-zA-Z0-9]+)$ index.php?qst=$1

However it limits the match to AlphaNum figures and I must inlcude, -, _ and also the # whether it's possible.

RewriteRule ^subdir/index\.php(.*) - [L]
RewriteRule ^subdir/(.*)$ /subdir/index.php?q=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^subdir/(.*)$ /subdir/index.php?q=$1

The RewriteCond inspections when the asked for document is not a current file, this way we do not obtain a recursive demand index.php

The following rule is a very common rewrite to request /subdir/index.php.