Forum Moderators: phranque

Message Too Old, No Replies

Quick rewrite question

I even provide what i think should work ;)

         

David Bruning

10:34 pm on Mar 2, 2005 (gmt 0)

10+ Year Member



I didn't think I would need to pester you guys again after having a working solution nicely running to work with.....but alas.

Here is the rule I've written

RewriteRule ^(.*)\.php$ index.php?team=$1 [L]

The intent is

you go to blah/blah/widget.php and it goes to index.php passing the widget part as the $team variable.

Rewrite base has it pointing to the right spot, it just doesn't seem to pass anything other than index for the $temp var.

Any ideas what I am missing?

TY as always :)

jdMorgan

10:44 pm on Mar 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does it seem to take a long time for the page to load, too? If so, it's looping, so the value of "team" will always get rewritten as "index." Use a RewriteCond to prevent looping:

RewriteCond %{REQUEST_URI} !index\.php$
RewriteRule ^(.*)\.php$ index.php?team=$1 [L]

Jim

David Bruning

11:00 pm on Mar 2, 2005 (gmt 0)

10+ Year Member



Didn't notice it taking very long.

But you are a god among men ;)

what you suggested works great . Thank you!