gevans Posted May 4, 2009 Share Posted May 4, 2009 I'm using htaccess to re-write, just wanted to make sure that this is the correct way to rewrite everything to index.php.. ##other code left out RewriteRule ^([A-Za-z0-9-/])$ index.php?path=$1 [L,NC] Do I need to escape the /? Link to comment https://forums.phpfreaks.com/topic/156811-solved-rewrite-everything-to-indexphp/ Share on other sites More sharing options...
gevans Posted May 4, 2009 Author Share Posted May 4, 2009 Hehe, missed the plus.. Options +FollowSymLinks RewriteEngine on RewriteRule ^([A-Za-z0-9-\/]+)$ index.php?path=$1 [L,NC] Link to comment https://forums.phpfreaks.com/topic/156811-solved-rewrite-everything-to-indexphp/#findComment-825889 Share on other sites More sharing options...
wildteen88 Posted May 4, 2009 Share Posted May 4, 2009 If sending everything to index.php then use (.*) as the pattern. But yea you're on the right lines Link to comment https://forums.phpfreaks.com/topic/156811-solved-rewrite-everything-to-indexphp/#findComment-825924 Share on other sites More sharing options...
gevans Posted May 4, 2009 Author Share Posted May 4, 2009 If sending everything to index.php then use (.*) as the pattern. But yea you're on the right lines I was going with everything but I want to restric to upper and lower case alphanumerical characters, hyphens and forward slashes. Anything more suitable thatn what I have so far? Link to comment https://forums.phpfreaks.com/topic/156811-solved-rewrite-everything-to-indexphp/#findComment-825931 Share on other sites More sharing options...
wildteen88 Posted May 4, 2009 Share Posted May 4, 2009 I see. yea that should do it. However you may want to allow for periods in case a filename gets passed maybe Link to comment https://forums.phpfreaks.com/topic/156811-solved-rewrite-everything-to-indexphp/#findComment-825942 Share on other sites More sharing options...
gevans Posted May 4, 2009 Author Share Posted May 4, 2009 Cheers for that, No filenames or extensions coming through the URI, cheers for the ehads up though Link to comment https://forums.phpfreaks.com/topic/156811-solved-rewrite-everything-to-indexphp/#findComment-825966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.