aspacecodyssey Posted February 18, 2010 Share Posted February 18, 2010 I'm doing a simple, nifty mod_rewrite on this website: http://www.reliabilityplus.net/ For example, This: http://www.reliabilityplus.net/page/General%20Contracting Is actually this: http://www.reliabilityplus.net/pics?page=General%20Contracting And This: http://www.reliabilityplus.net/page/General%20Contracting/Interior%20Home%20Renovation Is actually this: http://www.reliabilityplus.net/pics?page=General%20Contracting&pagesub=Interior%20Home%20Renovation This goes 3 deep (the last being http://www.reliabilityplus.net/page/General%20Contracting/Interior%20Home%20Renovation/Custom%20Chandelier%20Installation with "pagesubsub"), and this is my rule: RewriteRule page/(.*)/(.*)/(.*)/? pics?page=$1&pagesub=$2&pagesubsub=$3 RewriteRule page/(.*)/(.*)/? pics?page=$1&pagesub=$2 RewriteRule page/(.*)/? pics?page=$1 So it's a basic drilldown from most to least -- is there a way (with regex, I imagine) to just make it 1 rule? Quote Link to comment https://forums.phpfreaks.com/topic/192535-trying-to-shorten-my-mod_rewrite/ Share on other sites More sharing options...
cags Posted February 19, 2010 Share Posted February 19, 2010 I think the simple answer is no, there's not a way. Quote Link to comment https://forums.phpfreaks.com/topic/192535-trying-to-shorten-my-mod_rewrite/#findComment-1014844 Share on other sites More sharing options...
aspacecodyssey Posted February 19, 2010 Author Share Posted February 19, 2010 Well. Alright then. Quote Link to comment https://forums.phpfreaks.com/topic/192535-trying-to-shorten-my-mod_rewrite/#findComment-1014846 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.