3

Possible Duplicate:
How to use .htaccess in WAMP Server?

I'm using Wamp Server 2.0 on Windows 7 (32-bit) and want to make use of .htaccess files. I'm kinda new to server configs in general but from what I understand I have to "activate" usage of htaccess files in the httpd.conf file of Apache?

I have done the following:

In my httpd.conf file I've added these lines:

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

Then I created a .htaccess file in my sites root directory with the following lines

RewriteEngine on
RewriteBase /

RewriteRule ^articles/([A-Za-z0-9-]+) /articles/index.php?slug=$1%{QUERY_STRING} [PT, L]

However, I keep getting 500 Internal Server Errors when I try to load up the page. If I comment out the RewriteRule it works though. I can't figure out what I'm doing wrong.

Community
  • 1
  • 1
Weblurk
  • 6,562
  • 18
  • 64
  • 120

1 Answers1

4

Remove the space in between the flags of your RewriteRule. Also, you will need a RewriteCond to avoid infinite redirects.

 RewriteCond %{REQUEST_URI} !index.php$
 RewriteRule ^articles/([A-Za-z0-9-]+) /articles/index.php?slug=$1%{QUERY_STRING} [PT,L]

Hope that helps.

clmarquart
  • 4,721
  • 1
  • 27
  • 23
  • Thanks a bunch! It's funny how a simple little space could cause that much of a problem :) – Weblurk Apr 20 '11 at 07:48
  • +1 Good answer. For other readers still having problems, other places to look are vhosts.conf (you may or may not have this file in your *AMP stack) and check settings in there, particularly to ensure that `AllowOverride All` is set as for me this ensured Apache 'saw' my .htaccess file and stopped ignoring it. – therobyouknow Jul 06 '12 at 10:27