apache htaccess mod rewrite with php querystring urls
| From: | raisinlove | Date: | Thu, 12 Aug 2004 08:56:52 +0000 |
| Subject: | apache htaccess mod rewrite with php querystring urls | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-193536@lists.php.net to get a copy of this message | ||
Hi, I realize this isnt specificaly related to php, but most php 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
thanks for your help :)
-steph