Jump to content

Trying to shorten my mod_rewrite


aspacecodyssey

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/192535-trying-to-shorten-my-mod_rewrite/
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.