Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2010, 05:55 PM   PM User | #1
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
RewriteRule with Looping Variables?

Hi I am wanting to take a rewrite that has several variables and make it shorter. Basically make something that looks like this:
Code:
RewriteRule ^(.*)-results/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)$ index.php?cms_page=$1&results=true&$2=$3&$4=$5&$6=$7&$8=$9 [L]
And make it look like this:
Code:
  RewriteRule ^(.*)-results(/(.*)/(.*))$ index.php?cms_page=$1&results=true&$2=$3 [L]
Where the $2 and $3 variables loop to catch all of the options after it. Just curious if something like this is even possible. I thought I had seen something like it before, but I know I was searching for an IIS rewrite at the time.
Coyote6 is offline   Reply With Quote
Reply

Bookmarks

Tags
htaccess, looping, mod_rewrite, rewriterule, variables

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:32 PM.


Advertisement
Log in to turn off these ads.