Re: apache htaccess mod rewrite with php querystring urls

From: Date: Thu, 12 Aug 2004 11:58:09 +0000
Subject: Re: apache htaccess mod rewrite with php querystring urls
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193539@lists.php.net to get a copy of this message
Raisinlove a écrit :
Hi, I realize this isnt specificaly related to php, but most php hi
developers are familiar with this. My website uses an index.php file to load all content with a template, using urls like so: http://www.foo.com/index.php?page=splash.html In the same directory, there is a file called splash.html, but what I would like to do is that if the source file is called, the php file would load instead. So typing in: http://www.foo.com/splash.html would bring up: http://www.foo.com/index.php?page=splash.html instead. The solution I found was to use an .htaccess file, but it only brings up a 403 forbidden access error everytime. ModRewrite is enabled, so what could be the problem? Here is the code I used: RewriteEngine on RewriteBase / RewriteRule ^[A-Za-z0-9]\.html$ /index.php?page=$1 [A-Za-z0-9] will only match one character.
Try this : RewriteEngine on RewriteRule [A-Za-z0-9]+\.html$ /index.php?page=$1
thanks for your help :) -steph
-- Fabrice Lezoray http://classes.scriptsphp.fr -----------------------------

« previous php.general (#193539) next »