Reputation: 1350
I've been trying to enable URL rewriting in my development environment. I use EasyPHP 5.4.6. I'm trying to create a simple rewrite rule (rewrite /about-us/ to about-us.php) which affects one site (alias) only. I've placed the .htaccess file in the root folder of that page. I already took care about these things: 1. The mod_rewrite module IS loaded in httpd.conf 2. phpinfo() lists mod_rewrite among loaded modules 3. my rule is valid (tested online) 4. .htaccess is stored in the page's root folder 5. the site's folder is defined as an Alias in the configuration file 6. in that definition, AllowOverride is set to All
And guess what, the RewriteRule just doesn't work and I keep getting a 404 error. Any idea what could be causing this?
This is the alias definition from httpd.conf
Alias "/website" "C:/local/website"
<Directory "C:/local/website">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
Deny from all
Require all granted
And this is my .htaccess
RewriteEngine On
RewriteBase /
RewriteRule ([a-zA-Z0-9\-]+)/? $1.php
Upvotes: 1
Views: 4603
Reputation: 571
I would recommend using the module 'Virtual Hosts Manager' from EasyPHP.
Upvotes: 1
Reputation: 1724
You are using a "/website" alias, I think you should declare RewriteBase with the same value in the local .htaccess file (i.e. RewriteBase /website
).
Upvotes: 3