Allow user names with '.' char and pretty URLs

harimix
Joined: 11 Dec 2010

Allow user names with '.' char and pretty URLs

Posted:11 Dec 2010 (22:37 UTC)
I have installed Bitweaver for the first time. I'm going to like it as I explore how everything works.

I want to use usernames like firstname.lastname along with pretty URLs.

Found that users/.htaccess was not working as it should. After playing around for a while I have found a working .htaccess
here it is:

users/.htaccess (for bitweaver 2.8.1)

<?php
        RewriteEngine on
        
# Uncomment this if mod_rewrites are not working for you. some hosting services have cranky mod_rew$
        
RewriteBase             /users/

        
# These should pass existing files on through, but do not for some reason. needs to be debugged,
        # and then \. can be added to regex's below
#       RewriteCond %{DOCUMENT_ROOT}%{SCRIPT_FILENAME}  -f [OR]
#       RewriteCond %{DOCUMENT_ROOT}%{SCRIPT_FILENAME}/index.php    -f
#       RewriteRule ^/.*        - [L]

        
RewriteCond     %{SCRIPT_FILENAME}              -[OR]
        
RewriteCond     %{SCRIPT_FILENAME}/index.php    -f
        RewriteRule     
^(.*)$          - [L]

        
RewriteRule     ^view/([-A-Za-z0-9_\.]+)$       index.php?home=$[L,QSA]
        
RewriteRule     ^([-A-Za-z0-9_\.]+)$            index.php?home=$[L,QSA]
?>

maybe it helps other users and some developer will add this to the codebase.

Harald