I\'m really new at mod_rewrite and i have been trying to figure this out but really stuck. p Here is my issue.
I have a page http://example.com/user/?s=81 ?s=81 is
Here's what I would suggest: if your username is only alphanumeric chars, you could pass the nick to all your Php files, after an internal rewrite, in the GET
query.
Something like:
RewriteRule /([a-zA-Z0-9]+)$ /user/?s=$1 [QSA,L]
RewriteRule /([a-zA-Z0-9]+)/(.*)$ /$2?s=$1 [QSA,L]
And then, just have the "mother of mother" classes in Php that check for a value "s" in the query string ($_GET
) which checks in the database if the user exists. If the user doesn't exists, make a 404
in Php.