[FX.php List] [Off] Help with .htaccess RewriteRule or Redirect

Roger Moffat rogerkiwi at aol.com
Sat Mar 22 06:04:54 MDT 2008


On Mar 22, 2008, at 7:12 AM, Troy Meyers wrote:
> Thank you. I've been trying this and variations, both in the www.troymeyers.com 
>  and /flasking directories. Still no luck.
>
> Ones I've tried (all prefixed with RewriteEngine On):
>
> RewriteRule ^/flasking/(.*) http://lab.troymeyers.com/flasking/$1 [R]
> RewriteRule ^http://www.troymeyers.com/flasking/(.*) http://lab.troymeyers.com/flasking/$1 
>  [R]
> RewriteRule ^/flasking/(.*)$ http://lab.troymeyers.com/flasking/$1 [R]
> RewriteRule ^http://www,troymeyers.com/flasking/(.*)$ http://lab.troymeyers.com/flasking/$1 
>  [R]
>
> I still get 404 and the same page URL I started with for any of  
> these, in either directory, so rewrite doesn't seem to be occurring.

Well I'm stumped...

I created a flasking directory on my genealogy testing site here

http://testing.lisaandroger.com/

and put a .htaccess file into it which contains this

RewriteEngine On
RewriteRule ^/flasking/(.*) http://lab.troymeyers.com/flasking/$1 [R]

And as you note it doesn't work. And I'm certain that my Apache is set  
to deal with the .htaccess file as other things put in there do work.

But I put those same two lines into my virtual hosts config file (I'm  
using the Apache 2.2 that comes with Mac OS X Leopard) and you can see  
that it does work

http://testing.lisaandroger.com/flasking/something

redirects to

http://lab.troymeyers.com/flasking/something

But I'm blessed if I can figure out why that isn't being processed  
when it's part of the .htaccess file - according to all I read it  
should be.

Of interest is that this

Redirect /flasking/ http://lab.troymeyers.com/flasking/

does work when in the .htaccess file, and even seems to handle what's  
after the /flasking/ without the characters there for testing it  
specifically telling it to.

Roger


More information about the FX.php_List mailing list