On Wednesday 06 September 2006 10:12 am, Aaron J. Seigo wrote:
> On Wednesday 06 September 2006 8:47, Nick Wiltshire wrote:
> > Any ideas?
>
> posting the rewriterule you tried would be a nice first step. remember to
> explain the whole situation when explaining a problem you want help on
>

I had started to do that but I've tried so many concoctions I figured I'd try 
to simplify it first. :)

> as for your example problem, here's a rewrite rule that works:
>
>       RewriteRule ^/(.*) /index.php?var=$1
>

I tried that, but I think I may have oversimplified (see below)

> this, however:
>
>       RewriteRule ^/(.*) /?var=$1
>
> will loop infinitely for two reasons, which are fixed with this:
>

curious.

>       RewriteRule ^/(.+) /?var=$1 [R]
>
> unfortunately that leads to a user visible change to the URL in the
> browser. but it works.

Yeah, I'd prefer if it was cloak & dagger :)

So, I'll give a bit more info here. I need it to work in a sub directory or 
top level, obviously by changing the regexp. The reason for that is I want to 
get it working before I put it on the production box.

So, on my laptop I have:

RewriteRule ^/test/website/(.*) /test/website/index.php?var=$1

That does nothing, ie no redirect at all if I go to 
http://127.0.0.1/test/website/blah/ -- this seems odd.

If I change it to

RewriteRule /test/website/(.*) /test/website/index.php?var=$1

I get an internal server error. Not sure why, but then again I don't know why 
the beginning of line marker is preventing the redirect in the first example.

Your example above may work when the scripts are in the TLD, but for some 
reason adapting it is prooving to be more complicated than I thought.

I'm probably doing something blatantly stupid. 

Oh, another thing that might matter is I am putting these rules in the 
<Directory /> context. I tried them in server context too without much 
success.

Thanks,
Nick

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to