canadabeeau Posted January 22, 2010 Share Posted January 22, 2010 Hi I am currently running this mod_rewrite Options +FollowSymlinks RewriteEngine On RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ /index.php?uri=$1/$2/$3 RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ /index.php?uri=$1/$2 RewriteRule ^([a-zA-Z0-9]+)$ /index.php?uri=$1 Now I basically need a rule which will cater for $1 $2 $3 $4 etc by itself rather than me making it like in the above, I need a rule which will somehow automatically cope, any ideas? otherwise my mod_rewrite may get a bit messy :-( Quote Link to comment https://forums.phpfreaks.com/topic/189398-compacting-my-mod_rewrite-code/ Share on other sites More sharing options...
cags Posted January 22, 2010 Share Posted January 22, 2010 That will only add one extra line of code, how deep a directory structure are you planning on having because more than 4 is getting a little ridiculous. Quote Link to comment https://forums.phpfreaks.com/topic/189398-compacting-my-mod_rewrite-code/#findComment-999910 Share on other sites More sharing options...
canadabeeau Posted January 23, 2010 Author Share Posted January 23, 2010 hello cags, are you able to tell me the line of code to do it? Quote Link to comment https://forums.phpfreaks.com/topic/189398-compacting-my-mod_rewrite-code/#findComment-1000311 Share on other sites More sharing options...
canadabeeau Posted February 2, 2010 Author Share Posted February 2, 2010 cags or anyone? Quote Link to comment https://forums.phpfreaks.com/topic/189398-compacting-my-mod_rewrite-code/#findComment-1005379 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.