.htaccess periods

Discussion in 'Apache' started by gcspublish, Feb 11, 2008.

  1. #1
    RewriteEngine On

    #make the index work
    RewriteRule ^$ index.php

    #finds http://aardvarkspace.aardvarkforum.com/j.love
    #then turns it into http://aardvarkspace.aardvarkforum.com/j.love/
    #checks if there is no slash on the end
    RewriteCond %{REQUEST_URI} !/$
    #rewrites with the slash
    RewriteRule (^[-_A-Za-z0-9\ ].[-_A-Za-z0-9\ ]*)$ /$1/ [R=301,L]

    #Typical error document handler
    ErrorDocument 404 /notfound.php

    #if you go to http://aardvarkspace.aardvarkforum.com/j.love/ this makes it work

    RewriteCond %{REQUEST_URI} ^(.*)/
    RewriteRule ^([^/]*)/$ member.php?username=$1


    See how it has [-_A-Za-z0-9\ ].[-_A-Za-z0-9\ ] well its looking for period in the center somewhere
    When I try to make it look for EVERYTHING (including periods since usernames can have them),
    it just makes the thing go into an infinite loop or something
    Right now it can get j.love as a username but not a.b.c. as a username since that has multiple periods in it :(
     
    gcspublish, Feb 11, 2008 IP