I usually add:

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d

to keep requests that are going to actual files (images, docs, etc)
from being rewritten.

Craig

On Tue, Apr 22, 2008 at 9:43 AM, Wade Preston Shearer
<[EMAIL PROTECTED]> wrote:
>
> > Thank you. So Apache is where the rewrite needs to be done then?
> >
>
>  You can do it with PHP, but I recommend doing it with Apache. It can be
> done in the httpd.conf file or in a .htaccess file. I would recommend an
> .htaccess file as you do not have to restart Apache when you make changes
> and it can be versioned. There is a setting in your httpd.conf that has to
> be enabled for it to allow you to use a .htaccess file. Once that is
> enabled, you place a plain text file in the root of your web directory
> called ".htaccess" and put the rewrites in there. Google for "mod_rewrite"
> and "rewriterule" and you will get plenty of examples.
>
>  Here is an example (using the URL example in my earlier post) to get you
> started:
>
>  RewriteCond %{REQUEST_URI} ^/([a-z]*)/([0-9]*)$
>  RewriteRule ^/(.*)/(.*)$ /index.php?type=$1&id=$2 [NC,QSA,L]
>
>
>  The condition is optional. Most of the time you will want one so that the
> rule is only executed if the condition is met. In this example, the
> condition only matches URLs that are in the format…
>
>  example.com/<alpha string>/<number>
>
>  _______________________________________________
>
>  UPHPU mailing list
>  [email protected]
>  http://uphpu.org/mailman/listinfo/uphpu
>  IRC: #uphpu on irc.freenode.net
>


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to