Date: Sun, 12 Jul 2009 21:47:51 -0400 From: Michael Powell <nightrecon@verizon.net> To: freebsd-questions@freebsd.org Subject: Re: activate apache mod_rewrite Message-ID: <h3e3kl$ulg$1@ger.gmane.org> References: <200907121709.25015.ray@stilltech.net> <20090712195807.71c6ee6b@elune.fallendusk.org> <200907121903.16069.ray@stilltech.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Ray wrote: > On July 12, 2009 05:58:07 pm Gregory T Helton wrote: >> On Sun, 12 Jul 2009 17:09:24 -0600 >> >> Ray <ray@stilltech.net> wrote: >> > Hello, >> > I'm running FreeBSD 7.0-RELEASE-p3, amd64 >> > I have never used mod rewrite before, but I am about to be hosting a >> > php website that does use it and I can't figure out how to turn it on. >> > The website was working properly under other hosting. >> > >> > The server has been working properly for over a year with other php >> > websites. I installed apache 2.2 along with php 5.2 from ports. >> > >> > google says that the following lines should appear in httpd.conf >> > >> > LoadModule rewrite_module libexec/apache/mod_rewrite.so [snip] >> >> Try with just the LoadModule line. This is the only line I have for >> mod_rewrite in my httpd.conf, and it is working properly. >> >> iirc, the "AddModule" linux is apache 1.x specific. [snip] > > Thanks for the response. > The loadmodule line is already there. > Is there anything in the httpd-vhosts.conf or anywhere else needed to > activate rewrites? > thanks, > Ray http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html Various ways of utilizing it as it is very flexible, depending on your particular requirements. It usually involves at least a RewriteEngine On directive somewhere. Some can use it in an .htaccess but those who are running multiple vhosts may need something like this for each vhost: RewriteEngine On RewriteOptions Inherit See the section in the docs. Usually there are two other directives used to configure functionality after activating it. You will usually have one, or more, RewriteCond conditions which when evaluated run through a RewriteRule of some kind. Brush up on your Apache regex handling! There are cheat sheets around the web, easily Googled up. mod_rewrite is not easy and can have you pulling your hair out. If you are using a software that requires it the docs should have a cut and paste config that can get you started. Trying to figure it out from scratch without knowing what is needed will be next to impossible. -Mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?h3e3kl$ulg$1>