jaymc Posted December 2, 2007 Share Posted December 2, 2007 I have this code in a htacess file RewriteEngine on RewriteRule ^([^/\.]+)/?$ index.php?user=$1 [L] this allows this access method www.site.com/username to access www.site.com/index.php?user=username Working well, but, usernames that have a full stop in it are causing problems Is there a way around this? Link to comment https://forums.phpfreaks.com/topic/79759-solved-url-rewrite/ Share on other sites More sharing options...
marcus Posted December 2, 2007 Share Posted December 2, 2007 Full stop meaning what? RewriteEngine On RewriteRule ^(.*?)$ /index.php?user=$1 [L] Link to comment https://forums.phpfreaks.com/topic/79759-solved-url-rewrite/#findComment-403911 Share on other sites More sharing options...
jaymc Posted December 2, 2007 Author Share Posted December 2, 2007 www.site.com/username . 2007 So there actually username is username . 2007 The url rewrite doesnt like the dot, takes me to page cannot be displayed Link to comment https://forums.phpfreaks.com/topic/79759-solved-url-rewrite/#findComment-403919 Share on other sites More sharing options...
marcus Posted December 2, 2007 Share Posted December 2, 2007 Try something like: RewriteEngine On RewriteRule ^([^/]*)/$ /index.php?user=$1 [L] site.tld/user/ Link to comment https://forums.phpfreaks.com/topic/79759-solved-url-rewrite/#findComment-403922 Share on other sites More sharing options...
jaymc Posted December 2, 2007 Author Share Posted December 2, 2007 Page cannot be displayed http://site.com/L.F.C.%201 or http://site.com/L.F.C. 1 Infact, using that doesnt work for any usernames, even single word ones..? Link to comment https://forums.phpfreaks.com/topic/79759-solved-url-rewrite/#findComment-404203 Share on other sites More sharing options...
jaymc Posted December 2, 2007 Author Share Posted December 2, 2007 Ok, I've done a little bit of investigating and it definately does not like the full stop From what I gather, it confuses it with the actual file name period (.php) I know many other websites are successful with this, so there must be a way around Hope someone can help, I dont even know what to google for! Link to comment https://forums.phpfreaks.com/topic/79759-solved-url-rewrite/#findComment-404354 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.