[Novalug] How does htaccess work?

rich.goodwin@cox.net rich.goodwin@cox.net
Tue Nov 14 16:15:31 EST 2006


Jim,

Thanks.  I wish I had your response late last nite.  I found out it is more than redundent.  It is a fatal error!%^$#&^#&^&%*  What I entered was / http://domain/directory.  Which continually replaced domain/directory  for the domain/  This resulted in  an endless loop.  

So .... I am looking at what Peter sent me to rewrite the URL.  That seems to be the "better" answer long term anyway!

Rich


---- James Ewing Cottrell 3rd <JECottrell3@Comcast.NET> wrote: 
> Note that in most cases the http://www.domain.com is redundant and 
> merely associating / and /document are all that is needed.
> 
> JIM
> 
> Rich Goodwin wrote:
> 
> >On Mon, 2006-11-13 at 22:12 -0500, Peter S. May wrote:
> >  
> >
> >>-----BEGIN PGP SIGNED MESSAGE-----
> >>Hash: SHA1
> >>
> >>Joseph LeBlanc wrote:
> >>    
> >>
> >>>If I'm understanding what you're trying to do, I would think that this
> >>>.htaccess rule would work:
> >>>
> >>>RedirectMatch (.*) http://www.domain.com/directory$1
> >>>
> >>>This is similar to what I'm using to redirect an old subdomain to a new
> >>>domain.
> >>>      
> >>>
> >>This would probably work.
> >>
> >>    
> >>
> >>>You might have to add a check to make sure the request does not already
> >>>include '/directory' though.
> >>>      
> >>>
> >>I went to the trouble/misery of figuring out mod_rewrite a while back,
> >>so I would pull it off something like this:
> >>
> >>RewriteEngine on
> >>RewriteCond %{REQUEST_URI} !^/directory
> >>RewriteRule ^/(.*)$ /directory/$1 [R,L]
> >>
> >>Granted, a hit on http://www.example.com/directory/something would
> >>probably hit the .htaccess in /directory instead of in the root.  YMMV.
> >>
> >>Word
> >>PSM
> >>    
> >>
> >
> >OK ... so I learned that I should not be looking at the DIRECTORY
> >directive which is why I couldn't figure it out.  In doing so, I came
> >across the REDIRECT 301 command:
> >
> >redirect 301 / http://www.example.com/directory
> >
> >This looks to be slick - redirect everything.  But I am not sure of all
> >the drawbacks.  I do like the mod_rewrite and will look at that
> >tomorrow.  I now am waiting for the hosting service to replicate things.
> >
> >THANKS!!
> >
> >Rich
> >  
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Novalug mailing list
> >Novalug@calypso.tux.org
> >http://calypso.tux.org/cgi-bin/mailman/listinfo/novalug
> >  
> >
> >------------------------------------------------------------------------
> >
> >No virus found in this incoming message.
> >Checked by AVG Free Edition.
> >Version: 7.5.430 / Virus Database: 268.14.5/533 - Release Date: 11/13/2006 8:56 PM
> >  
> >
> 




More information about the Novalug mailing list