lnelson92
lnelson92

Reputation: 611

Basic URL Rewriting causing internal server error

I'm very new to this and have read a couple of articles on URL rewriting.

http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

http://coding.smashingmagazine.com/2011/11/02/introduction-to-url-rewriting/

All i want to do is change www.domain.com/single-recipe.php?id=6

To www.domain.com/recipes/6

From the tutorials I have come up with the following code in my .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

RewriteRule    ^recipes/([0-9]+)/?$    single-recipe.php?id=$1    [NC,L]    # Handle recipe requests

When i try to access any page on the site i am greeted with a lovely internal server error 500.

Any help would be appreciated.

Upvotes: 2

Views: 200

Answers (1)

Prasanth Bendra
Prasanth Bendra

Reputation: 32710

I think it is because of the extra space remove it and try :

RewriteRule ^recipes/([0-9]+)/?$ single-recipe.php?id=$1[NC,L]

Upvotes: 1

Related Questions