Jump to content

.htaccess periods


ninevolt

Recommended Posts

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 :(

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/90570-htaccess-periods/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.