Forum Moderators: phranque
My code:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(^/usr/)(.*)$
RewriteRule ^([^link].*)$ http://www.xyz.com/usr/?link=%2 [R,QSA,L]
and my index.php file is as follows:
isset($_GET['link'])? $usrnm = $_GET['link'] : $usrnm = '';
if ($usrnm != ''){
redirect to user profile
}
else {
redirect to home page
}
everything works when i use "/usr/auxiv" or any other user in our database EXCEPT users starting with l's such as lilly or linda or lonny or larry (etc) However, It DOES work
if i were to use Capital Letters Such as "/usr/Lilly" or "/usr/Linda" or "/usr/Lonny" These all work!
I have users that start with lowercase L's that need to access: /usr/larry (lowercase L).
I find this strange because it only seems to effect L's, all the other user names can use lowercase such as /usr/happy_gilmore
when a lower case L username is requested as such: "/usr/larry" it bypasses my htaccess file and looks in the "usr" directory for a folder named "larry" where it should be redirected to my php file for handling and redirect.
when an uppercase L is used such as: "/usr/Larry" the htaccess decides it wants to redirect to the php file
and then will handle correctly.
/usr/larry = 404
/usr/auxiv = ok
/usr/Larry = ok
/usr/dilbert = ok
I believe the problem to be within the htaccess because if the user doesnt exist the php is set to redirect to the home page (names not in the database). Where with lowercase L's it doesnt even redirect, instead it 404's (looking for the folder in the "usr" dir.
Thanks for any help!
RewriteEngine on
RewriteRule ^(.+)$ /usr/?link=$1 [QSA,L]
Note however that the syntax has been changed from that of an external redirect to that of an internal rewrite, so that the rewritten internal script path and query string *is not* exposed to the client (or to search engines).
Jim