Re: Re: Preserving URL after redirect?

From: Date: Thu, 06 Mar 2008 12:42:52 +0000
Subject: Re: Re: Preserving URL after redirect?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-271071@lists.php.net to get a copy of this message
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


« previous php.general (#271071) next »