1

I'm trying to rewrite a URL using the following rule:

RewriteRule ^([^/]*)$ /curation.php?id=$1 [L]

and this is an .htaccess file I created:

 RewriteEngine On
 RewriteRule ^([^/]*)$ /curation.php?id=$1 [L]

but when I push it to my Heroku server, I get a 500 Internal Server Error on all pages. What am I doing wrong?

Thanks

Taimur
  • 3,171
  • 8
  • 32
  • 38

2 Answers2

1

I think the main problem is you rewrite rule

try something like:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteRule ^([^/]+) index.php?id=$1 [L]
</IfModule>
Manuel van Rijn
  • 10,170
  • 1
  • 29
  • 52
1

If you have mod_rewrite loaded, and your rules are in an htaccess file in your document root. The rules that you have are causing an infinite loop. You need to add a condition or two to prevent that:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/curation\.php
RewriteRule ^([^/]*)$ /curation.php?id=$1 [L]

Or

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)$ /curation.php?id=$1 [L]
Jon Lin
  • 142,182
  • 29
  • 220
  • 220