Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod_rewrite query

Status
Not open for further replies.

col69

IS-IT--Management
Jun 22, 2002
7
GB
I need to redirect any .py file plus query string

e.g. test.py?var=1

located anywhere within the htdocs folder and its subfolders to a different port on the same machine. Another server on this port is meant to handle all .py requests. I've tried the following and variants thereof to no effect, can anyone help and tell me where I'm going wrong?

RewriteRule ^/(.*\.(py).*)$
and

RewriteRule ^(.*\.(py).*)$
TIA
 
Try something like this for your regular expression:

^/.*([^/]*.py\?.*)

Then google for a good tutorial on regular expressions. :)
 
Thanks, but that doesn't seem to work. As a side note what does this part do: [^/]*.

TIA
 
match anything that isn't a forward slash. Hence the regexp tutorial.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top