Re: Re: Preserving URL after redirect?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Skip Evans schreef:
(Apologies to Shawn for sending this directly to him and not the entire list, that was an accident. Here it is for the list.)

Shawn McKenzie wrote:
<SNIP!>

Rewrite rule would look something like:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?path=$1 [QSA,L]
</IfModule>

-Shawn


My httpd.conf file has this

LoadModule rewrite_module
libexec/apache2/mod_rewrite.so

But your .htaccess sample has

IfModule mod_rewrite.c

Is that okay?

yes the 'IfModule' means only parse the directive in that
block if the given module is loaded.


Also, it does look like .htaccess is enabled in
httpd.conf with entries like:

#
# AllowOverride controls what directives may be
placed in .htaccess files.
# It can be "All", "None", or any combination of
the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

#
# AccessFileName: The name of the file to look for
in each directory
# for additional configuration directives.  See
also the AllowOverride
# directive.
#
AccessFileName .htaccess

But when I tried out Shawn's file I got 404 errors
on the URLs (after renaming the wi directory, to
be sure the .htaccess file was in control.)

Any suggestions would be greatly appreciated.

use a rewritelog as Shawn mentioned to see what apache is
doing when it tries to rewrite the incoming urls.


I'm going through a pretty good page on htaccess files at

http://corz.org/serv/tricks/htaccess2.php

But it starts off with "Make no mistake, mod_rewrite is complex."

*gulp!*

big boys use mod_rewrite, go grab a kilt :-)

Skip



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux