My .htaccess file:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ photo.php?id=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ photo.php?id=$1
My goal is to convert the url mysite.com/photo.php?id=31 to mysite.com/31. But when i visit mysite.com/31, all i get is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Im running it on a wamp server.
Edit:
My current url looks like this: http://localhost:8080/img/photo.php?id=1. Do i need to add the /img-part to htaccess?
/img/directory? Do you have other rules elsewhere? - Jon Lin/img/directory but you want rewrites to happen in your document root (e.g.mysite.com/31)? - Jon Linmysite.com/img/31? - Jon Lin